1+ import fs from 'node:fs/promises'
2+ import { join , resolve , dirname } from 'node:path'
3+ import { fileURLToPath } from 'node:url'
14import minimist from 'minimist'
2- import _fs from 'fs'
3- import { join , resolve , dirname } from 'path'
4- import { fileURLToPath } from 'url'
55import chalk from 'chalk'
66import semver from 'semver'
77import enquirer from 'enquirer'
@@ -10,7 +10,6 @@ import pSeries from 'p-series'
1010import { globby } from 'globby'
1111
1212const { prompt } = enquirer
13- const fs = _fs . promises
1413
1514const __filename = fileURLToPath ( import . meta. url )
1615const __dirname = dirname ( __filename )
@@ -210,11 +209,23 @@ async function main() {
210209 console . log ( `(skipped)` )
211210 }
212211
212+ step ( '\nCopying README...' )
213+ if ( ! isDryRun ) {
214+ await fs . copyFile (
215+ resolve ( __dirname , '../README.md' ) ,
216+ resolve ( __dirname , 'README.md' )
217+ )
218+ } else {
219+ console . log ( `(skipped)` )
220+ }
221+
213222 const { stdout } = await run ( 'git' , [ 'diff' ] , { stdio : 'pipe' } )
214223 if ( stdout ) {
215224 step ( '\nCommitting changes...' )
216225 await runIfNotDry ( 'git' , [
217226 'add' ,
227+ 'packages/*/README.md' ,
228+ 'packages/*/LICENSE' ,
218229 'packages/*/CHANGELOG.md' ,
219230 'packages/*/package.json' ,
220231 ] )
@@ -345,9 +356,12 @@ async function getChangedPackages() {
345356 lastTag = stdout
346357 }
347358 // globby expects `/` even on windows
348- const folders = await globby ( ( join ( __dirname , '../packages/*' ) . replace ( / \\ / g, '/' ) ) , {
349- onlyFiles : false ,
350- } )
359+ const folders = await globby (
360+ join ( __dirname , '../packages/*' ) . replace ( / \\ / g, '/' ) ,
361+ {
362+ onlyFiles : false ,
363+ }
364+ )
351365
352366 const pkgs = await Promise . all (
353367 folders . map ( async folder => {
0 commit comments