mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-25 16:58:00 +08:00
0c97a6fa43
* test: faster test.yml * test: upgrade to node 20 * fix depends * fix needs * fix needs * fix needs * fix needs * test: update test.yml * test: update test.yml * test: update test.yml * test: update test.yml * test: update test.yml * test: update test.yml * test: update test.yml * test: update test.yml * test: update test.yml * fix: lib es test * fix: lib es test * fix: lib es test * skip dist test in react lagacy * Update test.yml Signed-off-by: afc163 <afc163@gmail.com> --------- Signed-off-by: afc163 <afc163@gmail.com>
30 lines
930 B
JavaScript
30 lines
930 B
JavaScript
const $ = require('dekko');
|
|
const chalk = require('chalk');
|
|
const fs = require('fs');
|
|
|
|
const includeUseClient = (filename) =>
|
|
fs.readFileSync(filename).toString().includes('"use client"');
|
|
|
|
$('dist/*')
|
|
.isFile()
|
|
.assert("doesn't contain use client", (filename) => !includeUseClient(filename));
|
|
$('{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!'));
|