mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 03:59:01 +08:00
72ee4517f0
* chore: init * chore: ellpsis check with native css * docs: all the lines * chore: move copied btn out * chore: add dpes * fix: logic order * fix: ellipsis event * test: update testcase * chore: use native way * chore: destructure * chore: fix lint * chore: fix lint * chore: fix lint
34 lines
1014 B
JavaScript
34 lines
1014 B
JavaScript
const $ = require('dekko');
|
|
const chalk = require('chalk');
|
|
const fs = require('fs');
|
|
|
|
const includeUseClient = (filename) =>
|
|
fs.readFileSync(filename).toString().includes('"use client"');
|
|
|
|
if (process.env.LIB_DIR === 'dist') {
|
|
$('dist/*')
|
|
.isFile()
|
|
.assert("doesn't contain use client", (filename) => !includeUseClient(filename));
|
|
} else {
|
|
$('{es,lib}/index.js')
|
|
.isFile()
|
|
.assert('contain use client', (filename) => includeUseClient(filename));
|
|
|
|
$('{es,lib}/*/index.js')
|
|
.isFile()
|
|
.assert('contain use client', (filename) => includeUseClient(filename));
|
|
|
|
// check tsx files
|
|
$('{es,lib}/typography/*.js')
|
|
.isFile()
|
|
.assert('contain use client', (filename) => includeUseClient(filename));
|
|
|
|
$('{es,lib}/typography/Base/*.js')
|
|
.isFile()
|
|
.filter((filename) => !filename.endsWith('/util.js'))
|
|
.assert('contain use client', (filename) => includeUseClient(filename));
|
|
}
|
|
|
|
// eslint-disable-next-line no-console
|
|
console.log(chalk.green('✨ use client passed!'));
|