chore(deps): update dependency chalk to v5 (#52109)
* 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>pull/52116/head
parent
4985db9d56
commit
ff52bbcc86
@ -1,5 +1,5 @@
|
||||
const $ = require('dekko');
|
||||
const chalk = require('chalk');
|
||||
import $ from 'dekko';
|
||||
import chalk from 'chalk';
|
||||
|
||||
$('dist')
|
||||
.isDirectory()
|
@ -1,3 +0,0 @@
|
||||
require('./dist.test');
|
||||
require('./lib-es.test');
|
||||
require('./use-client.test');
|
@ -0,0 +1,3 @@
|
||||
import './dist.test';
|
||||
import './lib-es.test';
|
||||
import './use-client.test';
|
@ -1,24 +0,0 @@
|
||||
const $ = require('dekko');
|
||||
const chalk = require('chalk');
|
||||
|
||||
$('lib').isDirectory().hasFile('index.js').hasFile('index.d.ts');
|
||||
|
||||
$('lib/*')
|
||||
.filter((filename) => !['index.js', 'index.d.ts', '.map'].some((ext) => filename.endsWith(ext)))
|
||||
.isDirectory()
|
||||
.filter((filename) => !['style', '_util', 'locale'].some((ext) => filename.endsWith(ext)))
|
||||
.hasFile('index.js')
|
||||
.hasFile('index.d.ts');
|
||||
|
||||
console.log(chalk.green('✨ `lib` directory is valid.'));
|
||||
|
||||
$('es').isDirectory().hasFile('index.js').hasFile('index.d.ts');
|
||||
|
||||
$('es/*')
|
||||
.filter((filename) => !['index.js', 'index.d.ts', '.map'].some((ext) => filename.endsWith(ext)))
|
||||
.isDirectory()
|
||||
.filter((filename) => !['style', '_util', 'locale'].some((ext) => filename.endsWith(ext)))
|
||||
.hasFile('index.js')
|
||||
.hasFile('index.d.ts');
|
||||
|
||||
console.log(chalk.green('✨ `es` directory is valid.'));
|
@ -0,0 +1,28 @@
|
||||
import $ from 'dekko';
|
||||
import chalk from 'chalk';
|
||||
|
||||
$('lib').isDirectory().hasFile('index.js').hasFile('index.d.ts');
|
||||
|
||||
$('lib/*')
|
||||
.filter(
|
||||
(filename: string) => !['index.js', 'index.d.ts', '.map'].some((ext) => filename.endsWith(ext)),
|
||||
)
|
||||
.isDirectory()
|
||||
.filter((filename: string) => !['style', '_util', 'locale'].some((ext) => filename.endsWith(ext)))
|
||||
.hasFile('index.js')
|
||||
.hasFile('index.d.ts');
|
||||
|
||||
console.log(chalk.green('✨ `lib` directory is valid.'));
|
||||
|
||||
$('es').isDirectory().hasFile('index.js').hasFile('index.d.ts');
|
||||
|
||||
$('es/*')
|
||||
.filter(
|
||||
(filename: string) => !['index.js', 'index.d.ts', '.map'].some((ext) => filename.endsWith(ext)),
|
||||
)
|
||||
.isDirectory()
|
||||
.filter((filename: string) => !['style', '_util', 'locale'].some((ext) => filename.endsWith(ext)))
|
||||
.hasFile('index.js')
|
||||
.hasFile('index.d.ts');
|
||||
|
||||
console.log(chalk.green('✨ `es` directory is valid.'));
|
@ -1,28 +0,0 @@
|
||||
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));
|
||||
|
||||
console.log(chalk.green('✨ use client passed!'));
|
@ -0,0 +1,28 @@
|
||||
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!'));
|
Loading…
Reference in New Issue