mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +08:00
chore: Migrate CJS to ESM (#42064)
This commit is contained in:
parent
6301ddf764
commit
f34f4d485f
@ -50,7 +50,7 @@
|
||||
"build": "npm run compile && NODE_OPTIONS='--max-old-space-size=4096' npm run dist",
|
||||
"size-limit": "size-limit",
|
||||
"check-commit": "node ./scripts/check-commit",
|
||||
"check-ts-demo": "node ./scripts/check-ts-demo",
|
||||
"check-ts-demo": "ts-node --esm --project tsconfig.node.json scripts/check-ts-demo.ts",
|
||||
"clean": "antd-tools run clean && rm -rf es lib coverage dist report.html",
|
||||
"clean-lockfiles": "rm -rf package-lock.json yarn.lock",
|
||||
"collect-token-statistic": "ts-node --project tsconfig.node.json scripts/collect-token-statistic.js",
|
||||
@ -175,6 +175,7 @@
|
||||
"@testing-library/jest-dom": "^5.16.3",
|
||||
"@testing-library/react": "^14.0.0",
|
||||
"@testing-library/user-event": "^14.4.2",
|
||||
"@types/fs-extra": "^11.0.1",
|
||||
"@types/gtag.js": "^0.0.12",
|
||||
"@types/isomorphic-fetch": "^0.0.36",
|
||||
"@types/jest": "^29.0.0",
|
||||
|
@ -1,10 +1,9 @@
|
||||
/* eslint-disable no-await-in-loop, no-console */
|
||||
|
||||
const path = require('path');
|
||||
const { globSync } = require('glob');
|
||||
const fs = require('fs-extra');
|
||||
const chalk = require('chalk');
|
||||
const { spawn } = require('child_process');
|
||||
import chalk from 'chalk';
|
||||
import { spawn } from 'child_process';
|
||||
import fs from 'fs-extra';
|
||||
import { globSync } from 'glob';
|
||||
import path from 'path';
|
||||
|
||||
(async () => {
|
||||
console.time('Execution...');
|
||||
@ -15,11 +14,11 @@ const { spawn } = require('child_process');
|
||||
await fs.remove(tmpFolder);
|
||||
await fs.ensureDir(tmpFolder);
|
||||
|
||||
function getTypescriptDemo(content, demoPath) {
|
||||
function getTypescriptDemo(content: string, demoPath: string) {
|
||||
const lines = content.split(/[\n\r]/);
|
||||
|
||||
const tsxStartLine = lines.findIndex((line) =>
|
||||
line.replace(/\s/g).toLowerCase().includes('```tsx'),
|
||||
line.replace(/\s/g, '').toLowerCase().includes('```tsx'),
|
||||
);
|
||||
|
||||
if (tsxStartLine < 0) {
|
||||
@ -72,7 +71,7 @@ const { spawn } = require('child_process');
|
||||
child.stdout.pipe(process.stdout);
|
||||
child.stderr.pipe(process.stderr);
|
||||
|
||||
child.on('exit', async (code) => {
|
||||
child.on('exit', async (code: number) => {
|
||||
console.timeEnd('Execution...');
|
||||
|
||||
if (code) {
|
Loading…
Reference in New Issue
Block a user