@@ -48,7 +48,7 @@ function getLibraryPackageDirs(): string[] {
4848/** Read and parse a package's package.json */
4949function readPackageJson ( pkgDir : string ) : Record < string , unknown > {
5050 const filePath = path . join ( PACKAGES_DIR , pkgDir , "package.json" ) ;
51- return JSON . parse ( fs . readFileSync ( filePath , "utf8 " ) ) ;
51+ return JSON . parse ( fs . readFileSync ( filePath , "utf-8 " ) ) ;
5252}
5353
5454/** Recursively collect all .ts/.tsx files under a directory */
@@ -254,7 +254,7 @@ describe("Property 2: No stale imports remain", () => {
254254 const violations : { file : string ; line : string ; pattern : string } [ ] = [ ] ;
255255
256256 for ( const file of sourceFiles ) {
257- const content = fs . readFileSync ( file , "utf8 " ) ;
257+ const content = fs . readFileSync ( file , "utf-8 " ) ;
258258 const lines = content . split ( "\n" ) ;
259259
260260 for ( const line of lines ) {
@@ -286,7 +286,7 @@ describe("Property 2: No stale imports remain", () => {
286286
287287 assert (
288288 property ( constantFrom ( ...sourceFiles ) , ( file ) => {
289- const content = fs . readFileSync ( file , "utf8 " ) ;
289+ const content = fs . readFileSync ( file , "utf-8 " ) ;
290290 return STALE_PATTERNS . every ( ( p ) => ! p . test ( content ) ) ;
291291 } ) ,
292292 { numRuns : Math . min ( sourceFiles . length , 100 ) }
@@ -347,7 +347,7 @@ describe("Property 3: Package boundary enforcement", () => {
347347 const violations : { pkg : string ; file : string ; line : string } [ ] = [ ] ;
348348
349349 for ( const { pkgDir, file } of files ) {
350- const content = fs . readFileSync ( file , "utf8 " ) ;
350+ const content = fs . readFileSync ( file , "utf-8 " ) ;
351351 const lines = content . split ( "\n" ) ;
352352 for ( const line of lines ) {
353353 if ( / (?: f r o m | i m p o r t ) \s + [ " ' ] @ \/ / . test ( line ) ) {
@@ -373,7 +373,7 @@ describe("Property 3: Package boundary enforcement", () => {
373373 const violations : { pkg : string ; file : string ; line : string } [ ] = [ ] ;
374374
375375 for ( const { pkgDir, file } of files ) {
376- const content = fs . readFileSync ( file , "utf8 " ) ;
376+ const content = fs . readFileSync ( file , "utf-8 " ) ;
377377 const imports = extractImports ( content ) ;
378378 for ( const imp of imports ) {
379379 if ( imp . startsWith ( "../" ) || imp . startsWith ( "../../" ) ) {
@@ -406,7 +406,7 @@ describe("Property 3: Package boundary enforcement", () => {
406406
407407 assert (
408408 property ( constantFrom ( ...files ) , ( { pkgDir, file } ) => {
409- const content = fs . readFileSync ( file , "utf8 " ) ;
409+ const content = fs . readFileSync ( file , "utf-8 " ) ;
410410 if ( / (?: f r o m | i m p o r t ) \s + [ " ' ] @ \/ / . test ( content ) ) {
411411 return false ;
412412 }
@@ -440,7 +440,7 @@ describe("Property 3: Package boundary enforcement", () => {
440440describe ( "Property 8: Environment variable completeness" , ( ) => {
441441 /** Extract env var names from a keys.ts file's runtimeEnv block */
442442 function extractEnvVarsFromKeysFile ( filePath : string ) : string [ ] {
443- const content = fs . readFileSync ( filePath , "utf8 " ) ;
443+ const content = fs . readFileSync ( filePath , "utf-8 " ) ;
444444 const vars : string [ ] = [ ] ;
445445 const processEnvRegex = / p r o c e s s \. e n v \. ( [ A - Z _ ] [ A - Z 0 - 9 _ ] * ) / g;
446446 let match : RegExpExecArray | null ;
@@ -467,7 +467,7 @@ describe("Property 8: Environment variable completeness", () => {
467467 /** Get all declared env vars from turbo.json (all task env + globalEnv) */
468468 function getTurboEnvVars ( ) : { exact : Set < string > ; wildcards : string [ ] } {
469469 const turboJson = JSON . parse (
470- fs . readFileSync ( MONOREPO_TURBO_JSON_PATH , "utf8 " )
470+ fs . readFileSync ( MONOREPO_TURBO_JSON_PATH , "utf-8 " )
471471 ) ;
472472 const exact = new Set < string > ( ) ;
473473 const wildcards : string [ ] = [ ] ;
@@ -611,7 +611,7 @@ describe("Property 9: No direct process.env access in packages", () => {
611611 continue ;
612612 }
613613
614- const content = fs . readFileSync ( file , "utf8 " ) ;
614+ const content = fs . readFileSync ( file , "utf-8 " ) ;
615615 const strippedContent = stripComments ( content ) ;
616616 const lines = strippedContent . split ( "\n" ) ;
617617 for ( let i = 0 ; i < lines . length ; i += 1 ) {
@@ -657,7 +657,7 @@ describe("Property 9: No direct process.env access in packages", () => {
657657
658658 assert (
659659 property ( constantFrom ( ...nonKeysFiles ) , ( file ) => {
660- const content = fs . readFileSync ( file , "utf8 " ) ;
660+ const content = fs . readFileSync ( file , "utf-8 " ) ;
661661 const stripped = stripComments ( content ) ;
662662 const lines = stripped . split ( "\n" ) ;
663663 return lines . every ( ( line ) => ! hasRealProcessEnvAccess ( line ) ) ;
@@ -699,7 +699,7 @@ describe("Property 10: Import path correctness", () => {
699699 const violations : { file : string ; importPath : string } [ ] = [ ] ;
700700
701701 for ( const file of sourceFiles ) {
702- const content = fs . readFileSync ( file , "utf8 " ) ;
702+ const content = fs . readFileSync ( file , "utf-8 " ) ;
703703 const imports = extractImports ( content ) ;
704704
705705 for ( const imp of imports ) {
@@ -739,7 +739,7 @@ describe("Property 10: Import path correctness", () => {
739739
740740 assert (
741741 property ( constantFrom ( ...sourceFiles ) , ( file ) => {
742- const content = fs . readFileSync ( file , "utf8 " ) ;
742+ const content = fs . readFileSync ( file , "utf-8 " ) ;
743743 const imports = extractImports ( content ) ;
744744 for ( const imp of imports ) {
745745 const isPortal = imp . startsWith ( "@portal/" ) ;
@@ -787,7 +787,7 @@ describe("Property 11: App-internal alias preservation", () => {
787787 let foundAppInternalImports = false ;
788788
789789 for ( const file of appFiles ) {
790- const content = fs . readFileSync ( file , "utf8 " ) ;
790+ const content = fs . readFileSync ( file , "utf-8 " ) ;
791791 const imports = extractImports ( content ) ;
792792
793793 for ( const imp of imports ) {
@@ -812,7 +812,7 @@ describe("Property 11: App-internal alias preservation", () => {
812812
813813 assert (
814814 property ( constantFrom ( ...appFiles ) , ( file ) => {
815- const content = fs . readFileSync ( file , "utf8 " ) ;
815+ const content = fs . readFileSync ( file , "utf-8 " ) ;
816816 const imports = extractImports ( content ) ;
817817 for ( const imp of imports ) {
818818 for ( const pattern of APP_INTERNAL_PATTERNS ) {
@@ -924,7 +924,7 @@ describe("Property 14: Package dependency completeness", () => {
924924 // dependencies since they resolve through the app's bundler
925925 if ( PACKAGES_WITH_APP_IMPORTS . has ( pkgDir ) ) {
926926 const appPkgPath = path . join ( ROOT_DIR , "package.json" ) ;
927- const appPkg = JSON . parse ( fs . readFileSync ( appPkgPath , "utf8 " ) ) ;
927+ const appPkg = JSON . parse ( fs . readFileSync ( appPkgPath , "utf-8 " ) ) ;
928928 for ( const dep of Object . keys (
929929 ( appPkg . dependencies ?? { } ) as Record < string , string >
930930 ) ) {
@@ -942,7 +942,7 @@ describe("Property 14: Package dependency completeness", () => {
942942 const undeclared : { file : string ; importPkg : string } [ ] = [ ] ;
943943
944944 for ( const file of files ) {
945- const content = fs . readFileSync ( file , "utf8 " ) ;
945+ const content = fs . readFileSync ( file , "utf-8 " ) ;
946946 // Use strict imports (ES only) to skip optional require() in try/catch
947947 const imports = extractStrictImports ( content ) ;
948948
0 commit comments