@@ -12,7 +12,6 @@ import { afterAll, beforeAll, describe, expect, it } from 'vitest';
1212
1313// eslint-disable-next-line n/no-missing-import
1414import { api } from '../../../api/core/dist/api' ;
15- import { initLink } from '../../../api/core/src/api/init-scripts/init-link' ;
1615
1716describe ( 'ViteTypeScriptTemplate' , ( ) => {
1817 let dir : string ;
@@ -85,59 +84,6 @@ describe('ViteTypeScriptTemplate', () => {
8584 // Vite resolves plugins via cwd
8685 cwd = process . cwd ( ) ;
8786 process . chdir ( dir ) ;
88- /**
89- * LOCKFILE FIXTURE USAGE:
90- * We use a pre-generated lockfile to avoid needing to disable Yarn's security features.
91- *
92- * When to regenerate the fixture:
93- * - When vite version is updated in Forge's package.json
94- * - When template dependencies change significantly
95- * - When Yarn lockfile format changes
96- * - When this test starts failing due to dependency resolution issues
97- *
98- * How to regenerate:
99- * Run: yarn ts-node tools/regenerate-lockfile-fixtures.ts
100- *
101- * This will create a new lockfile with the correct vite resolution and dependencies.
102- */
103- // Copy pre-generated lockfile and update the project name
104- const fixtureLockfile = path . join (
105- __dirname ,
106- 'fixtures' ,
107- 'test-yarn.lock' ,
108- ) ;
109- const targetLockfile = path . join ( dir , 'yarn.lock' ) ;
110- let lockfileContent = await fs . promises . readFile (
111- fixtureLockfile ,
112- 'utf-8' ,
113- ) ;
114-
115- // Get the current project name from package.json
116- const currentPackageJson = JSON . parse (
117- await fs . promises . readFile ( path . join ( dir , 'package.json' ) , 'utf-8' ) ,
118- ) ;
119- const projectName = currentPackageJson . name ;
120-
121- // Replace the fixture project name with the actual project name
122- lockfileContent = lockfileContent . replace (
123- / e l e c t r o n - f o r g e - t e s t - \d + / g,
124- projectName ,
125- ) ;
126- await fs . promises . writeFile ( targetLockfile , lockfileContent ) ;
127-
128- // Install with immutable lockfile (no modifications needed)
129- await spawnPackageManager (
130- PACKAGE_MANAGERS [ 'yarn' ] ,
131- [ 'install' , '--immutable' ] ,
132- {
133- cwd : dir ,
134- } ,
135- ) ;
136-
137- // Installing deps removes symlinks that were added at the start of this
138- // spec via `api.init`. So we should re-link local forge dependencies
139- // again.
140- await initLink ( PACKAGE_MANAGERS [ 'yarn' ] , dir ) ;
14187 } ) ;
14288
14389 afterAll ( ( ) => {
0 commit comments