File tree Expand file tree Collapse file tree 5 files changed +16
-17
lines changed Expand file tree Collapse file tree 5 files changed +16
-17
lines changed Original file line number Diff line number Diff line change @@ -111,23 +111,14 @@ export function createMemoryEnvironment(returnPathsRelativeTo: string = '') {
111111
112112 const { fs, vol } = memfs ( { } )
113113
114- const cwd = process . cwd ( )
115- const isInCwd = ( path : string ) => path . startsWith ( cwd )
116- const isTemplatePath = ( path : string ) => ! isInCwd ( path )
117-
118114 environment . appendFile = async ( path : string , contents : string ) => {
119115 fs . mkdirSync ( dirname ( path ) , { recursive : true } )
120116 await fs . appendFileSync ( path , contents )
121117 }
122118 environment . copyFile = async ( from : string , to : string ) => {
123- if ( isTemplatePath ( from ) ) {
124- const contents = ( await readFile ( from ) ) . toString ( )
125- fs . mkdirSync ( dirname ( to ) , { recursive : true } )
126- fs . writeFileSync ( to , contents )
127- } else {
128- fs . mkdirSync ( dirname ( to ) , { recursive : true } )
129- fs . copyFileSync ( from , to )
130- }
119+ fs . mkdirSync ( dirname ( to ) , { recursive : true } )
120+ fs . copyFileSync ( from , to )
121+ return Promise . resolve ( )
131122 }
132123 environment . execute = async ( command : string , args : Array < string > ) => {
133124 output . commands . push ( {
Original file line number Diff line number Diff line change 1+ export const TMP_TARGET_DIR = '/__cta-tmp__'
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ import {
1212 writeConfigFileToEnvironment ,
1313} from '@tanstack/cta-engine'
1414
15+ import { TMP_TARGET_DIR } from '../constants.js'
16+
1517import { cleanUpFileArray , cleanUpFiles } from './file-helpers.js'
1618import { getProjectPath } from './server-environment.js'
1719import { createAppWrapper } from './create-app-wrapper.js'
@@ -37,7 +39,7 @@ export async function addToAppWrapper(
3739 }
3840
3941 const options = await createAppOptionsFromPersisted ( persistedOptions )
40- options . targetDir = projectPath
42+ options . targetDir = opts . dryRun ? TMP_TARGET_DIR : projectPath
4143
4244 const newAddons : Array < string > = [ ]
4345 for ( const addOn of addOns ) {
Original file line number Diff line number Diff line change 99 loadStarter ,
1010} from '@tanstack/cta-engine'
1111
12+ import { TMP_TARGET_DIR } from '../constants.js'
13+
1214import { registerFrameworks } from './framework-registration.js'
1315
1416import { cleanUpFileArray , cleanUpFiles } from './file-helpers.js'
@@ -51,8 +53,9 @@ export async function createAppWrapper(
5153 )
5254
5355 const projectPath = getProjectPath ( )
54- const targetDir =
55- getApplicationMode ( ) === 'add'
56+ const targetDir = opts . dryRun
57+ ? TMP_TARGET_DIR
58+ : getApplicationMode ( ) === 'add'
5659 ? projectOptions . targetDir
5760 : resolve ( projectPath , projectOptions . projectName )
5861
Original file line number Diff line number Diff line change @@ -22,8 +22,10 @@ body {
2222 -moz-osx-font-smoothing : grayscale;
2323}
2424
25- code {
26- font-size : 12px ;
25+ code ,
26+ .cm-theme ,
27+ .cm-merge-theme {
28+ font-size : 16px ;
2729 font-family :
2830 'JetBrains Mono' ,
2931 Menlo,
You can’t perform that action at this time.
0 commit comments