Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps-dev): bump chalk from 4.1.2 to 5.4.1 #423

Merged
merged 4 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .dumi/theme/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { createHash } from 'crypto';
import fs from 'fs';
import path from 'path';
import createEmotionServer from '@emotion/server/create-instance';
import chalk from 'chalk';
import type { IApi, IRoute } from 'dumi';
import ReactTechStack from 'dumi/dist/techStacks/react';
import sylvanas from 'sylvanas';
Expand Down Expand Up @@ -126,9 +125,9 @@ class AntdReactTechStack extends ReactTechStack {

const resolve = (p: string): string => require.resolve(p);

const RoutesPlugin = (api: IApi) => {
const RoutesPlugin = async (api: IApi) => {
// const ssrCssFileName = `ssr-${Date.now()}.css`;

const chalk = await import('chalk').then((m) => m.default);
const writeCSSFile = (key: string, hashKey: string, cssString: string) => {
const fileName = `style-${key}.${getHash(hashKey)}.css`;

Expand Down
Binary file modified bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
"start": "tsx ./scripts/set-node-options.ts cross-env PORT=8001 dumi dev",
"pretest": "npm run version",
"test": "jest --config .jest.js --no-cache --collect-coverage",
"test:dekko": "node ./tests/dekko/index.test.js",
"test:dekko": "tsx ./tests/dekko/index.test.ts",
"test:image": "jest --config .jest.image.js --no-cache -i -u --forceExit",
"test:node": "npm run version && jest --config .jest.node.js --no-cache",
"test:package-diff": "antd-tools run package-diff",
Expand Down Expand Up @@ -164,7 +164,7 @@
"axios": "^1.7.7",
"browserslist": "^4.23.3",
"browserslist-to-esbuild": "^2.1.1",
"chalk": "^4.1.2",
"chalk": "^5.4.1",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure that your project is compatible with pure ESM packages, as chalk version 5.0.0 and above are pure ESM. This may require updates to your build or runtime environment, especially if you are using TypeScript, which needs to be version 4.7 or later.

"cheerio": "^1.0.0",
"circular-dependency-plugin": "^5.2.2",
"cli-progress": "^3.12.0",
Expand Down
4 changes: 2 additions & 2 deletions tests/dekko/dist.test.js → tests/dekko/dist.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const $ = require('dekko');
const chalk = require('chalk');
import chalk from 'chalk';
import $ from 'dekko';

$('dist').isDirectory().hasFile('antdx.js').hasFile('antdx.min.js').hasFile('antdx.min.js.map');

Expand Down
4 changes: 0 additions & 4 deletions tests/dekko/index.test.js

This file was deleted.

4 changes: 4 additions & 0 deletions tests/dekko/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import './dist.test';
import './lib.test';
// Not applied yet
// import './use-client.test';
8 changes: 4 additions & 4 deletions tests/dekko/lib.test.js → tests/dekko/lib.test.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
const $ = require('dekko');
const chalk = require('chalk');
import chalk from 'chalk';
import $ from 'dekko';

$('lib').isDirectory().hasFile('index.js').hasFile('index.d.ts');

$('lib/*')
.filter(
(filename) =>
(filename: string) =>
!filename.endsWith('index.js') &&
!filename.endsWith('index.d.ts') &&
!filename.endsWith('.map'),
)
.isDirectory()
.filter(
(filename) =>
(filename: string) =>
!filename.endsWith('style') &&
!filename.endsWith('_util') &&
!filename.endsWith('locale') &&
Expand Down
33 changes: 0 additions & 33 deletions tests/dekko/use-client.test.js

This file was deleted.

33 changes: 33 additions & 0 deletions tests/dekko/use-client.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import fs from 'node:fs';
import chalk from 'chalk';
import $ from 'dekko';

const includeUseClient = (filename: string) =>
fs.readFileSync(filename).toString().includes('"use client"');

if (process.env.LIB_DIR === 'dist') {
$('dist/*')
.isFile()
.assert("doesn't contain use client", (filename: string) => !includeUseClient(filename));
} else {
$('{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));
}

// eslint-disable-next-line no-console
console.log(chalk.green('✨ use client passed!'));
2 changes: 2 additions & 0 deletions typings/custom-typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ declare module '@npmcli/run-script' {
}

declare module '@microflash/rehype-figure';

declare module 'dekko';
Loading