Skip to content

Commit 0012abf

Browse files
committed
chore: update cli/src/config.ts (1 modified)
1 parent f6c242d commit 0012abf

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

cli/src/config.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,13 @@ const DEFAULT_SHADOW_SOURCE_PROJECT: Required<ShadowSourceProjectConfig> = {
2929
}
3030

3131
const DEFAULT_OPTIONS: Required<PluginOptions> = {
32-
...DEFAULT_USER_CONFIG,
32+
version: DEFAULT_USER_CONFIG.version ?? '0.0.0',
33+
workspaceDir: DEFAULT_USER_CONFIG.workspaceDir ?? '~/project',
34+
logLevel: DEFAULT_USER_CONFIG.logLevel ?? 'info',
3335
shadowSourceProject: DEFAULT_SHADOW_SOURCE_PROJECT,
3436
fastCommandSeriesOptions: {},
3537
plugins: []
36-
} as Required<PluginOptions>
38+
}
3739

3840
/**
3941
* Convert UserConfigFile to PluginOptions
@@ -205,7 +207,9 @@ export async function defineConfig(options: PluginOptions | DefineConfigOptions
205207
})
206208
}
207209

208-
ensureShadowProjectConfigLink(path.join(mergedOptions.workspaceDir, mergedOptions.shadowSourceProject.name), logger) // Auto-link .tnmsc.json into shadow source project dir
210+
if (mergedOptions.workspaceDir != null) { // Auto-link .tnmsc.json into shadow source project dir (skip if workspaceDir unavailable, e.g. CI without napi binary)
211+
ensureShadowProjectConfigLink(path.join(mergedOptions.workspaceDir, mergedOptions.shadowSourceProject.name), logger)
212+
}
209213

210214
const baseCtx: Omit<InputPluginContext, 'dependencyContext' | 'globalScope' | 'scopeRegistry'> = { // Base context without dependencyContext, globalScope, scopeRegistry (will be provided by pipeline)
211215
logger,

0 commit comments

Comments
 (0)