77import * as fs from 'node:fs' ;
88import * as path from 'node:path' ;
99
10- import tsConfig from '../tsconfig.json' with { type : 'json' } ;
11-
1210import { sed } from './sed.ts' ;
1311
1412const BUILD_DIR = path . join ( process . cwd ( ) , 'build' ) ;
@@ -22,28 +20,6 @@ function writeFile(filePath: string, content: string): void {
2220 fs . writeFileSync ( filePath , content , 'utf-8' ) ;
2321}
2422
25- /**
26- * Ensures that licenses for third party files we use gets copied into the build/ dir.
27- */
28- function copyThirdPartyLicenseFiles ( ) {
29- const thirdPartyDirectories = tsConfig . include . filter ( location => {
30- return location . includes (
31- 'node_modules/chrome-devtools-frontend/front_end/third_party' ,
32- ) ;
33- } ) ;
34-
35- for ( const thirdPartyDir of thirdPartyDirectories ) {
36- const fullPath = path . join ( process . cwd ( ) , thirdPartyDir ) ;
37- const licenseFile = path . join ( fullPath , 'LICENSE' ) ;
38- if ( ! fs . existsSync ( licenseFile ) ) {
39- console . error ( 'No LICENSE for' , path . basename ( thirdPartyDir ) ) ;
40- }
41-
42- const destinationDir = path . join ( BUILD_DIR , thirdPartyDir ) ;
43- const destinationFile = path . join ( destinationDir , 'LICENSE' ) ;
44- fs . copyFileSync ( licenseFile , destinationFile ) ;
45- }
46- }
4723
4824function main ( ) : void {
4925 const devtoolsThirdPartyPath =
@@ -113,22 +89,6 @@ export const experiments = {
11389 sed ( clientFile , globalAssignment , '' ) ;
11490 sed ( clientFile , registerCommands , '' ) ;
11591
116- const devtoolsLicensePath = path . join (
117- 'node_modules' ,
118- 'chrome-devtools-frontend' ,
119- 'LICENSE' ,
120- ) ;
121- const devtoolsLicenseFileSource = path . join (
122- process . cwd ( ) ,
123- devtoolsLicensePath ,
124- ) ;
125- const devtoolsLicenseFileDestination = path . join (
126- BUILD_DIR ,
127- devtoolsLicensePath ,
128- ) ;
129- fs . copyFileSync ( devtoolsLicenseFileSource , devtoolsLicenseFileDestination ) ;
130-
131- copyThirdPartyLicenseFiles ( ) ;
13292 copyDevToolsDescriptionFiles ( ) ;
13393}
13494
0 commit comments