@@ -9,7 +9,6 @@ import * as assert from 'node:assert';
99import * as fs from 'node:fs' ;
1010import * as path from 'node:path' ;
1111import {
12- BUILT_IN_FULL_TEMPLATES ,
1312 PLACEHOLDER_KEYS ,
1413 WINDOWS_MAX_ALLOWABLE_PATH_LENGTH ,
1514 PACKAGE_DIR_PLACEHOLDER ,
@@ -63,7 +62,7 @@ const UI_BUNDLE_PLACEHOLDERS: Record<(typeof PLACEHOLDER_KEYS)[number], string>
6362 * pack:verify measures paths under node_modules, e.g. node_modules/@salesforce/templates/lib/...
6463 */
6564const PACKAGE_TEMPLATES_PREFIX =
66- 'node_modules/@salesforce/templates/lib/templates/project/ ' ;
65+ 'node_modules/@salesforce/templates/lib/templates/' ;
6766
6867function * walkFiles ( dir : string , relativeTo : string ) : Generator < string > {
6968 if ( ! fs . existsSync ( dir ) ) {
@@ -107,32 +106,19 @@ describe('Placeholder sync (copy-templates.js ↔ uiBundleTemplateUtils.ts)', ()
107106} ) ;
108107
109108describe ( 'Windows path length (pack:verify)' , ( ) => {
110- it ( 'project template paths (reactinternalapp, reactexternalapp) stay within Windows max allowable path length' , function ( ) {
109+ it ( 'all template files stay within Windows max allowable path length' , function ( ) {
111110 const templatesRoot = getTemplateRoot ( ) ;
112111 if ( ! templatesRoot ) {
113112 this . skip ( ) ;
114113 return ;
115114 }
116115
117- const projectRoot = path . join ( templatesRoot , 'project' ) ;
118- if ( ! fs . existsSync ( projectRoot ) ) {
119- this . skip ( ) ;
120- return ;
121- }
122-
123116 const longPaths : { length : number ; path : string } [ ] = [ ] ;
124117
125- for ( const templateName of BUILT_IN_FULL_TEMPLATES ) {
126- const templateDir = path . join ( projectRoot , templateName ) ;
127- if ( ! fs . existsSync ( templateDir ) ) {
128- continue ;
129- }
130-
131- for ( const rel of walkFiles ( templateDir , templateDir ) ) {
132- const packagePath = PACKAGE_TEMPLATES_PREFIX + templateName + '/' + rel ;
133- if ( packagePath . length >= WINDOWS_MAX_ALLOWABLE_PATH_LENGTH ) {
134- longPaths . push ( { length : packagePath . length , path : packagePath } ) ;
135- }
118+ for ( const rel of walkFiles ( templatesRoot , templatesRoot ) ) {
119+ const packagePath = PACKAGE_TEMPLATES_PREFIX + rel ;
120+ if ( packagePath . length >= WINDOWS_MAX_ALLOWABLE_PATH_LENGTH ) {
121+ longPaths . push ( { length : packagePath . length , path : packagePath } ) ;
136122 }
137123 }
138124
0 commit comments