1- import { join } from 'path' ;
2- import { rm , cp , readFile , writeFile } from 'fs/promises' ;
1+ import { join } from 'path' ;
2+ import { rm , cp , readFile , writeFile } from 'fs/promises' ;
33import yargs from 'yargs' ;
4- import { hideBin } from 'yargs/helpers' ;
5- import { globSync as glob } from 'tinyglobby' ;
6- import { executeCommand } from '../runner/utils/exec.js' ;
4+ import { hideBin } from 'yargs/helpers' ;
5+ import { globSync as glob } from 'tinyglobby' ;
6+ import { executeCommand } from '../runner/utils/exec.js' ;
77
88const root = join ( import . meta. dirname , '..' ) ;
99const runnerSource = join ( root , 'runner' ) ;
@@ -28,7 +28,7 @@ const args = yargs(hideBin(process.argv))
2828 console . log ( 'Building release output...' ) ;
2929
3030 // Clear out the target directory.
31- await rm ( targetDirectory , { recursive : true , force : true } ) ;
31+ await rm ( targetDirectory , { recursive : true , force : true } ) ;
3232
3333 // Build the runner. This also creates `dist`.
3434 await executeCommand ( 'pnpm build-runner' , runnerSource , undefined , {
@@ -38,7 +38,7 @@ const args = yargs(hideBin(process.argv))
3838 // Generate the package.json.
3939 await writeFile (
4040 join ( targetDirectory , 'package.json' ) ,
41- await getPackageJson ( join ( root , 'package.json' ) , args . version )
41+ await getPackageJson ( join ( root , 'package.json' ) , args . version ) ,
4242 ) ;
4343
4444 // Copy the readme and license.
@@ -50,18 +50,10 @@ const args = yargs(hideBin(process.argv))
5050 glob ( '**/*' , {
5151 cwd : join ( root , 'examples' ) ,
5252 dot : true ,
53- ignore : [
54- '**/node_modules/**' ,
55- '**/dist/**' ,
56- '**/.vinxi/**' ,
57- '**/.output/**' ,
58- ] ,
59- } ) . map ( ( agentFile ) =>
60- cp (
61- join ( root , 'examples' , agentFile ) ,
62- join ( targetDirectory , 'examples' , agentFile )
63- )
64- )
53+ ignore : [ '**/node_modules/**' , '**/dist/**' , '**/.vinxi/**' , '**/.output/**' ] ,
54+ } ) . map ( agentFile =>
55+ cp ( join ( root , 'examples' , agentFile ) , join ( targetDirectory , 'examples' , agentFile ) ) ,
56+ ) ,
6557 ) ;
6658
6759 // The user journey testing requires various files to work.
@@ -71,12 +63,12 @@ const args = yargs(hideBin(process.argv))
7163 cwd : join ( root , browserAgentRelativePath ) ,
7264 dot : true ,
7365 ignore : [ '*.ts' , 'README.md' ] ,
74- } ) . map ( ( agentFile ) =>
66+ } ) . map ( agentFile =>
7567 cp (
7668 join ( root , browserAgentRelativePath , agentFile ) ,
77- join ( targetDirectory , browserAgentRelativePath , agentFile )
78- )
79- )
69+ join ( targetDirectory , browserAgentRelativePath , agentFile ) ,
70+ ) ,
71+ ) ,
8072 ) ;
8173
8274 if ( ! args . runnerOnly ) {
@@ -86,16 +78,13 @@ const args = yargs(hideBin(process.argv))
8678 } ) ;
8779
8880 // Copy the report artifacts into the `dist`.
89- await cp ( reportAppDist , targetDirectory , { recursive : true } ) ;
81+ await cp ( reportAppDist , targetDirectory , { recursive : true } ) ;
9082 }
9183
9284 console . log ( `Release output has been built in ${ targetDirectory } ` ) ;
9385} ) ( ) ;
9486
95- async function getPackageJson (
96- path : string ,
97- version : string | null
98- ) : Promise < string > {
87+ async function getPackageJson ( path : string , version : string | null ) : Promise < string > {
9988 const content = await readFile ( path , 'utf8' ) ;
10089 const parsed = JSON . parse ( content ) as {
10190 version : string ;
@@ -106,9 +95,7 @@ async function getPackageJson(
10695
10796 if ( version ) {
10897 if ( version === parsed . version ) {
109- throw new Error (
110- `Specified version is the same version as the current one.`
111- ) ;
98+ throw new Error ( `Specified version is the same version as the current one.` ) ;
11299 } else {
113100 parsed . version = version ;
114101 }
0 commit comments