Skip to content

Commit cea25a0

Browse files
committed
feat: switch from prettier to lightningcss
1 parent 7b4fe5b commit cea25a0

File tree

3 files changed

+267
-29
lines changed

3 files changed

+267
-29
lines changed

package-lock.json

+259-23
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/typewind/package.json

+1-2
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,11 @@
4848
"@babel/plugin-syntax-jsx": "^7.18.6",
4949
"@babel/preset-typescript": "^7.18.6",
5050
"eval": "^0.1.8",
51-
"prettier": "^2.8.3",
51+
"lightningcss": "^1.19.0",
5252
"tsup": "^6.5.0"
5353
},
5454
"devDependencies": {
5555
"@types/babel__core": "^7.20.0",
56-
"@types/prettier": "^2.7.2",
5756
"release-it": "^15.6.0"
5857
}
5958
}

packages/typewind/src/cli.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,19 @@
22

33
import fs from 'fs';
44
import path from 'path';
5-
import prettier from 'prettier';
5+
import { transform } from 'lightningcss';
66
import { createTypewindContext, loadConfig } from './utils';
77

88
function createDoc(doc: string) {
99
try {
1010
let cssDoc = `
1111
* \`\`\`css
12-
* ${prettier
13-
.format(doc, { parser: 'css', tabWidth: 4 })
14-
.replace(/\n/g, '\n *')}
12+
* ${transform({
13+
filename: 'doc.css',
14+
code: Buffer.from(doc),
15+
})
16+
.code.toString()
17+
.replace(/\n/g, '\n * ')}
1518
* \`\`\`
1619
`;
1720
const config = loadConfig();

0 commit comments

Comments
 (0)