mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-07 17:44:35 +08:00
![renovate[bot]](/assets/img/avatar_default.png)
* chore(deps): update dependency chalk to v5 * migrate chalk * Update .github/workflows/test.yml Signed-off-by: afc163 <afc163@gmail.com> --------- Signed-off-by: afc163 <afc163@gmail.com> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: afc163 <afc163@gmail.com>
29 lines
937 B
TypeScript
29 lines
937 B
TypeScript
import $ from 'dekko';
|
|
import chalk from 'chalk';
|
|
import fs from 'node:fs';
|
|
|
|
const includeUseClient = (filename: string) =>
|
|
fs.readFileSync(filename).toString().includes('"use client"');
|
|
|
|
$('dist/*')
|
|
.isFile()
|
|
.assert("doesn't contain use client", (filename: string) => !includeUseClient(filename));
|
|
$('{es,lib}/index.js')
|
|
.isFile()
|
|
.assert('contain use client', (filename: string) => includeUseClient(filename));
|
|
$('{es,lib}/*/index.js')
|
|
.isFile()
|
|
.assert('contain use client', (filename: string) => includeUseClient(filename));
|
|
|
|
// check tsx files
|
|
$('{es,lib}/typography/*.js')
|
|
.isFile()
|
|
.assert('contain use client', (filename: string) => includeUseClient(filename));
|
|
|
|
$('{es,lib}/typography/Base/*.js')
|
|
.isFile()
|
|
.filter((filename: string) => !filename.endsWith('/util.js'))
|
|
.assert('contain use client', (filename: string) => includeUseClient(filename));
|
|
|
|
console.log(chalk.green('✨ use client passed!'));
|