@pixpilot/scaffoldfy 0.37.0 → 0.39.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -11
- package/dist/cli.cjs +1 -1
- package/dist/cli.js +1 -1
- package/dist/config-DFR0mwj6.js +1 -0
- package/dist/config-DZmWkoaW.cjs +1 -0
- package/dist/configurations-Bjun5iKX.js +1 -0
- package/dist/configurations-KSynsxPT.cjs +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +65 -302
- package/dist/index.d.ts +65 -302
- package/dist/index.js +1 -1
- package/dist/run-tasks--KK3MvU0.js +26 -0
- package/dist/run-tasks-B0buAbAD.cjs +1 -0
- package/dist/run-tasks-BPQFQ9vD.js +1 -0
- package/dist/run-tasks-DU00U3qI.cjs +26 -0
- package/dist/src-BYAwq7zv.cjs +1 -0
- package/dist/src-DBk71cIW.js +1 -0
- package/dist/utils-C-yGs5_V.cjs +1 -0
- package/dist/utils-DXSrTxhI.js +1 -0
- package/package.json +4 -4
- package/schema/scaffoldfy.schema.json +3 -3
- package/dist/config-C8hh88Lc.js +0 -1
- package/dist/config-DmK0Erv2.cjs +0 -1
- package/dist/run-tasks-Br8zYcP5.js +0 -1
- package/dist/run-tasks-DMTj-u4M.cjs +0 -1
- package/dist/run-tasks-JGU1NDnc.js +0 -26
- package/dist/run-tasks-bN0ievNj.cjs +0 -26
- package/dist/src-D4brxyaM.js +0 -1
- package/dist/src-DbmnAuCC.cjs +0 -1
- package/dist/template-inheritance-BVct9RJf.js +0 -1
- package/dist/template-inheritance-Ds-FkR_6.cjs +0 -1
- package/dist/utils-1Uvvc2xc.cjs +0 -1
- package/dist/utils-413ckp1r.js +0 -1
- /package/dist/{config-DlJs75hK.cjs → config-CQ-mWBG5.cjs} +0 -0
- /package/dist/{config-DfRbCqsT.js → config-nfiOxhDM.js} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -228,7 +228,7 @@ interface DefaultValueConfig<T = string | number | boolean> {
|
|
|
228
228
|
* - For explicit static values, use { type: 'static', value: yourValue }
|
|
229
229
|
* - For conditional defaults, use { type: 'conditional', condition: 'expression', ifTrue: value, ifFalse: value }
|
|
230
230
|
* - For interpolate strings, use { type: 'interpolate', value: '{{variable}}' } (will be interpolated with previously resolved prompts/variables)
|
|
231
|
-
* - For exec-file, use { type: 'exec-file', file: 'path/to/script
|
|
231
|
+
* - For exec-file, use { type: 'exec-file', file: 'path/to/script', args: [...], parameters: {...} }
|
|
232
232
|
*/
|
|
233
233
|
type DefaultValue<T = string | number | boolean> = T | DefaultValueConfig<T> | ConditionalDefaultConfig<T> | ExecFileValueConfig;
|
|
234
234
|
/**
|
|
@@ -267,7 +267,7 @@ interface BasePrompt {
|
|
|
267
267
|
required?: DynamicBooleanValue;
|
|
268
268
|
enabled?: DynamicBooleanValue;
|
|
269
269
|
override?: MergeStrategy;
|
|
270
|
-
$
|
|
270
|
+
$configEnabled?: DynamicBooleanValue;
|
|
271
271
|
$sourceUrl?: string;
|
|
272
272
|
transformers?: string[];
|
|
273
273
|
}
|
|
@@ -307,7 +307,7 @@ interface VariableDefinition {
|
|
|
307
307
|
enabled?: DynamicBooleanValue;
|
|
308
308
|
required?: DynamicBooleanValue;
|
|
309
309
|
override?: MergeStrategy;
|
|
310
|
-
$
|
|
310
|
+
$configEnabled?: DynamicBooleanValue;
|
|
311
311
|
$sourceUrl?: string;
|
|
312
312
|
transformers?: string[];
|
|
313
313
|
}
|
|
@@ -342,7 +342,7 @@ interface TaskDefinition {
|
|
|
342
342
|
rollback?: RollbackConfig;
|
|
343
343
|
override?: MergeStrategy;
|
|
344
344
|
$sourceUrl?: string;
|
|
345
|
-
$
|
|
345
|
+
$configEnabled?: DynamicBooleanValue;
|
|
346
346
|
}
|
|
347
347
|
/**
|
|
348
348
|
* Configuration file structure for template tasks
|
|
@@ -382,19 +382,62 @@ interface PluginHooks {
|
|
|
382
382
|
onError?: (error: Error, task?: TaskDefinition) => Promise<void>;
|
|
383
383
|
}
|
|
384
384
|
//#endregion
|
|
385
|
-
//#region src/
|
|
385
|
+
//#region src/configurations/cache.d.ts
|
|
386
386
|
/**
|
|
387
|
-
*
|
|
387
|
+
* Clear the configuration cache (useful for testing)
|
|
388
388
|
*/
|
|
389
|
-
declare function
|
|
389
|
+
declare function clearConfigurationCache(): void;
|
|
390
|
+
//#endregion
|
|
391
|
+
//#region src/configurations/load-configuration.d.ts
|
|
392
|
+
/**
|
|
393
|
+
* Load a configuration file from local path or remote URL
|
|
394
|
+
* @param configPath - Path or URL to the configuration file
|
|
395
|
+
* @param visitedPaths - Set of already visited paths to detect circular dependencies
|
|
396
|
+
* @returns The loaded configuration
|
|
397
|
+
*/
|
|
398
|
+
declare function loadConfiguration(configPath: string, visitedPaths?: Set<string>): Promise<TasksConfiguration>;
|
|
399
|
+
//#endregion
|
|
400
|
+
//#region src/configurations/load-tasks-with-inheritance.d.ts
|
|
401
|
+
/**
|
|
402
|
+
* Recursively load and merge configurations
|
|
403
|
+
* @param configPath - Path or URL to the configuration file
|
|
404
|
+
* @param baseDir - Base directory or URL for resolving relative paths in extends
|
|
405
|
+
* @param visitedPaths - Set of already visited paths
|
|
406
|
+
* @returns Merged configuration
|
|
407
|
+
*/
|
|
408
|
+
declare function loadAndMergeConfiguration(configPath: string, baseDir?: string, visitedPaths?: Set<string>): Promise<TasksConfiguration>;
|
|
409
|
+
/**
|
|
410
|
+
* Load tasks from a configuration file with configuration inheritance support
|
|
411
|
+
* @param tasksFilePath - Path to the tasks configuration file
|
|
412
|
+
* @param options - Optional configuration
|
|
413
|
+
* @param options.sequential - If true, return configurations as separate items for sequential processing
|
|
414
|
+
* @returns Task configuration with tasks, optional variables, and optional prompts
|
|
415
|
+
*/
|
|
416
|
+
declare function loadTasksWithInheritance(tasksFilePath: string, options?: {
|
|
417
|
+
sequential?: boolean;
|
|
418
|
+
}): Promise<{
|
|
419
|
+
tasks: TaskDefinition[];
|
|
420
|
+
variables?: VariableDefinition[];
|
|
421
|
+
prompts?: PromptDefinition[];
|
|
422
|
+
enabled?: EnabledValue;
|
|
423
|
+
configs?: TasksConfiguration[];
|
|
424
|
+
transformers?: Transformer[];
|
|
425
|
+
}>;
|
|
426
|
+
//#endregion
|
|
427
|
+
//#region src/configurations/merge-configurations.d.ts
|
|
390
428
|
/**
|
|
391
|
-
*
|
|
429
|
+
* Merge multiple configurations
|
|
430
|
+
* Later configurations override earlier ones for conflicting task IDs
|
|
431
|
+
* @param configurations - Array of configurations to merge (in priority order)
|
|
432
|
+
* @returns Merged configuration
|
|
392
433
|
*/
|
|
393
|
-
declare function
|
|
434
|
+
declare function mergeConfigurations(configurations: TasksConfiguration[]): TasksConfiguration;
|
|
435
|
+
//#endregion
|
|
436
|
+
//#region src/dry-run/content-tasks.d.ts
|
|
394
437
|
/**
|
|
395
|
-
* Get diff for
|
|
438
|
+
* Get diff for update-json task
|
|
396
439
|
*/
|
|
397
|
-
declare function
|
|
440
|
+
declare function getUpdateJsonDiff(config: UpdateJsonConfig, initConfig: InitConfig): Promise<string>;
|
|
398
441
|
/**
|
|
399
442
|
* Get diff for regex-replace task
|
|
400
443
|
*/
|
|
@@ -403,6 +446,8 @@ declare function getRegexReplaceDiff(config: RegexReplaceConfig, initConfig: Ini
|
|
|
403
446
|
* Get diff for replace-in-file task
|
|
404
447
|
*/
|
|
405
448
|
declare function getReplaceInFileDiff(config: ReplaceInFileConfig, initConfig: InitConfig): Promise<string>;
|
|
449
|
+
//#endregion
|
|
450
|
+
//#region src/dry-run/file-tasks.d.ts
|
|
406
451
|
/**
|
|
407
452
|
* Get diff for delete task
|
|
408
453
|
*/
|
|
@@ -411,6 +456,8 @@ declare function getDeleteDiff(config: DeleteConfig, initConfig: InitConfig): st
|
|
|
411
456
|
* Get diff for rename task
|
|
412
457
|
*/
|
|
413
458
|
declare function getRenameDiff(config: RenameConfig, initConfig: InitConfig): string;
|
|
459
|
+
//#endregion
|
|
460
|
+
//#region src/dry-run/system-tasks.d.ts
|
|
414
461
|
/**
|
|
415
462
|
* Get diff for git-init task
|
|
416
463
|
*/
|
|
@@ -419,6 +466,8 @@ declare function getGitInitDiff(config: GitInitConfig): string;
|
|
|
419
466
|
* Get diff for exec task
|
|
420
467
|
*/
|
|
421
468
|
declare function getExecDiff(config: ExecConfig, initConfig: InitConfig): string;
|
|
469
|
+
//#endregion
|
|
470
|
+
//#region src/dry-run/index.d.ts
|
|
422
471
|
/**
|
|
423
472
|
* Get diff for any task type
|
|
424
473
|
*/
|
|
@@ -471,26 +520,6 @@ declare function clearPlugins(): void;
|
|
|
471
520
|
* @param hooks - Hook functions to register
|
|
472
521
|
*/
|
|
473
522
|
declare function registerHooks(hooks: Partial<PluginHooks>): void;
|
|
474
|
-
/**
|
|
475
|
-
* Call a lifecycle hook
|
|
476
|
-
* @param hookName - Name of the hook
|
|
477
|
-
* @param config - Initialization config for beforeAll/afterAll
|
|
478
|
-
*/
|
|
479
|
-
declare function callHook(hookName: 'beforeAll' | 'afterAll', config: InitConfig): Promise<void>;
|
|
480
|
-
/**
|
|
481
|
-
* Call a lifecycle hook
|
|
482
|
-
* @param hookName - Name of the hook
|
|
483
|
-
* @param task - Task definition for beforeTask/afterTask
|
|
484
|
-
* @param config - Initialization config
|
|
485
|
-
*/
|
|
486
|
-
declare function callHook(hookName: 'beforeTask' | 'afterTask', task: TaskDefinition, config: InitConfig): Promise<void>;
|
|
487
|
-
/**
|
|
488
|
-
* Call a lifecycle hook
|
|
489
|
-
* @param hookName - Name of the hook
|
|
490
|
-
* @param error - Error that occurred
|
|
491
|
-
* @param task - Optional task definition
|
|
492
|
-
*/
|
|
493
|
-
declare function callHook(hookName: 'onError', error: Error, task?: TaskDefinition): Promise<void>;
|
|
494
523
|
/**
|
|
495
524
|
* Execute a plugin task
|
|
496
525
|
* @param task - The task to execute
|
|
@@ -502,19 +531,6 @@ declare function callHook(hookName: 'onError', error: Error, task?: TaskDefiniti
|
|
|
502
531
|
declare function executePluginTask(task: TaskDefinition, config: InitConfig, options: {
|
|
503
532
|
dryRun: boolean;
|
|
504
533
|
}): Promise<void>;
|
|
505
|
-
/**
|
|
506
|
-
* Get diff for a plugin task
|
|
507
|
-
* @param task - The task to generate diff for
|
|
508
|
-
* @param config - The initialization config
|
|
509
|
-
* @returns Diff string or undefined if not supported
|
|
510
|
-
*/
|
|
511
|
-
declare function getPluginTaskDiff(task: TaskDefinition, config: InitConfig): Promise<string | undefined>;
|
|
512
|
-
/**
|
|
513
|
-
* Validate a plugin task
|
|
514
|
-
* @param task - The task to validate
|
|
515
|
-
* @returns Array of validation errors
|
|
516
|
-
*/
|
|
517
|
-
declare function validatePluginTask(task: TaskDefinition): string[];
|
|
518
534
|
/**
|
|
519
535
|
* Create a simple task plugin
|
|
520
536
|
* @param name - Plugin name
|
|
@@ -534,280 +550,27 @@ declare function createTaskPlugin(name: string, taskType: string, execute: (task
|
|
|
534
550
|
validate?: (task: TaskDefinition) => string[];
|
|
535
551
|
}): TaskPlugin;
|
|
536
552
|
//#endregion
|
|
537
|
-
//#region src/prompts/collect-prompts.d.ts
|
|
538
|
-
/**
|
|
539
|
-
* Collect prompt answers from task-defined prompts
|
|
540
|
-
* Only prompts with enabled=true (or enabled condition that evaluates to true) will be shown
|
|
541
|
-
* @param prompts - Array of prompt definitions from tasks
|
|
542
|
-
* @param resolvedDefaults - Map of pre-resolved default values
|
|
543
|
-
* @param config - Current configuration context (for evaluating enabled conditions)
|
|
544
|
-
* @returns Object mapping prompt IDs to their values
|
|
545
|
-
*/
|
|
546
|
-
declare function collectPrompts(prompts: PromptDefinition[], resolvedDefaults?: Map<string, unknown>, config?: InitConfig): Promise<Record<string, unknown>>;
|
|
547
|
-
//#endregion
|
|
548
|
-
//#region src/prompts/resolve-all-default-values.d.ts
|
|
549
|
-
/**
|
|
550
|
-
* Pre-resolve all executable default values in parallel
|
|
551
|
-
* @param prompts - Array of prompt definitions
|
|
552
|
-
* @param context - Optional context for interpolating template variables
|
|
553
|
-
* @returns Map of prompt IDs to their resolved default values
|
|
554
|
-
*/
|
|
555
|
-
declare function resolveAllDefaultValues(prompts: PromptDefinition[], context?: InitConfig): Promise<Map<string, unknown>>;
|
|
556
|
-
//#endregion
|
|
557
|
-
//#region src/prompts/resolve-default-value.d.ts
|
|
558
|
-
/**
|
|
559
|
-
* Resolve a default value that may be static or executable
|
|
560
|
-
* @param defaultValue - The default value configuration
|
|
561
|
-
* @param promptId - The prompt ID for error reporting
|
|
562
|
-
* @param context - Optional context for interpolating template variables in string defaults
|
|
563
|
-
* @param prompt - Optional prompt definition for accessing $sourceUrl
|
|
564
|
-
* @returns The resolved default value
|
|
565
|
-
*/
|
|
566
|
-
declare function resolveDefaultValue<T = string | number | boolean>(defaultValue: DefaultValue<T> | undefined, promptId: string, context?: InitConfig, prompt?: PromptDefinition): Promise<T | undefined>;
|
|
567
|
-
//#endregion
|
|
568
|
-
//#region src/prompts/validate-prompts.d.ts
|
|
569
|
-
/**
|
|
570
|
-
* Validate prompt definitions
|
|
571
|
-
* @param prompts - Array of prompt definitions to validate
|
|
572
|
-
* @returns Array of validation error messages
|
|
573
|
-
*/
|
|
574
|
-
declare function validatePrompts(prompts: PromptDefinition[]): string[];
|
|
575
|
-
//#endregion
|
|
576
|
-
//#region src/run-tasks.d.ts
|
|
577
|
-
/**
|
|
578
|
-
* Core task execution logic shared by both main() and runWithTasks()
|
|
579
|
-
*/
|
|
580
|
-
declare function runTasks(tasks: TaskDefinition[], options: {
|
|
581
|
-
dryRun: boolean;
|
|
582
|
-
force: boolean;
|
|
583
|
-
tasksFilePath: string | undefined;
|
|
584
|
-
variables?: VariableDefinition[];
|
|
585
|
-
prompts?: PromptDefinition[];
|
|
586
|
-
templateEnabled?: EnabledValue;
|
|
587
|
-
transformers?: Transformer[];
|
|
588
|
-
}): Promise<void>;
|
|
589
|
-
/**
|
|
590
|
-
* Run templates sequentially for variables/prompts, then all tasks together
|
|
591
|
-
* Phase 1: Process variables and prompts sequentially from each template
|
|
592
|
-
* Phase 2: Collect all tasks from all enabled templates
|
|
593
|
-
* Phase 3: Execute all tasks together at the end
|
|
594
|
-
* This allows later templates to use values from earlier templates in their conditions,
|
|
595
|
-
* while still executing all tasks together after all variables/prompts are resolved
|
|
596
|
-
*/
|
|
597
|
-
declare function runTemplatesSequentially(templates: TasksConfiguration[], options: {
|
|
598
|
-
dryRun: boolean;
|
|
599
|
-
force: boolean;
|
|
600
|
-
tasksFilePath: string | undefined;
|
|
601
|
-
}, config?: InitConfig): Promise<void>;
|
|
602
|
-
//#endregion
|
|
603
|
-
//#region src/task-executors.d.ts
|
|
604
|
-
declare function registerBuiltInPlugins(): void;
|
|
605
|
-
/**
|
|
606
|
-
* Execute a task based on its type
|
|
607
|
-
*/
|
|
608
|
-
declare function executeTask(task: TaskDefinition, config: InitConfig, dryRun?: boolean): Promise<void>;
|
|
609
|
-
/**
|
|
610
|
-
* Run a single task with error handling
|
|
611
|
-
*/
|
|
612
|
-
declare function runTask(task: TaskDefinition, config: InitConfig, taskNumber: number, totalTasks: number, dryRun?: boolean): Promise<boolean>;
|
|
613
|
-
//#endregion
|
|
614
|
-
//#region src/task-resolver.d.ts
|
|
615
|
-
/**
|
|
616
|
-
* Sort tasks by dependencies using topological sort
|
|
617
|
-
*/
|
|
618
|
-
declare function topologicalSort(tasks: TaskDefinition[]): TaskDefinition[];
|
|
619
|
-
//#endregion
|
|
620
|
-
//#region src/template-inheritance.d.ts
|
|
621
|
-
/**
|
|
622
|
-
* Load a template configuration file from local path or remote URL
|
|
623
|
-
* @param templatePath - Path or URL to the template file
|
|
624
|
-
* @param visitedPaths - Set of already visited paths to detect circular dependencies
|
|
625
|
-
* @returns The loaded template configuration
|
|
626
|
-
*/
|
|
627
|
-
declare function loadTemplate(templatePath: string, visitedPaths?: Set<string>): Promise<TasksConfiguration>;
|
|
628
|
-
/**
|
|
629
|
-
* Load all templates in dependency order without merging
|
|
630
|
-
* @param templatePath - Path or URL to the template file
|
|
631
|
-
* @param baseDir - Base directory or URL for resolving relative paths in extends
|
|
632
|
-
* @param visitedPaths - Set of already visited paths
|
|
633
|
-
* @returns Array of sorted templates (in dependency order, ready for sequential processing)
|
|
634
|
-
*/
|
|
635
|
-
declare function loadTemplatesInOrder(templatePath: string, baseDir?: string, visitedPaths?: Set<string>): Promise<TasksConfiguration[]>;
|
|
636
|
-
/**
|
|
637
|
-
* Recursively load and merge templates
|
|
638
|
-
* @param templatePath - Path or URL to the template file
|
|
639
|
-
* @param baseDir - Base directory or URL for resolving relative paths in extends
|
|
640
|
-
* @param visitedPaths - Set of already visited paths
|
|
641
|
-
* @returns Merged template configuration
|
|
642
|
-
*/
|
|
643
|
-
declare function loadAndMergeTemplate(templatePath: string, baseDir?: string, visitedPaths?: Set<string>): Promise<TasksConfiguration>;
|
|
644
|
-
/**
|
|
645
|
-
* Merge multiple template configurations
|
|
646
|
-
* Later templates override earlier ones for conflicting task IDs
|
|
647
|
-
* @param templates - Array of templates to merge (in priority order)
|
|
648
|
-
* @returns Merged template configuration
|
|
649
|
-
*/
|
|
650
|
-
declare function mergeTemplates(templates: TasksConfiguration[]): TasksConfiguration;
|
|
651
|
-
/**
|
|
652
|
-
* Clear the template cache (useful for testing)
|
|
653
|
-
*/
|
|
654
|
-
declare function clearTemplateCache(): void;
|
|
655
|
-
/**
|
|
656
|
-
* Load tasks from a configuration file with template inheritance support
|
|
657
|
-
* @param tasksFilePath - Path to the tasks configuration file
|
|
658
|
-
* @param options - Optional configuration
|
|
659
|
-
* @param options.sequential - If true, return templates as separate items for sequential processing
|
|
660
|
-
* @returns Task configuration with tasks, optional variables, and optional prompts
|
|
661
|
-
*/
|
|
662
|
-
declare function loadTasksWithInheritance(tasksFilePath: string, options?: {
|
|
663
|
-
sequential?: boolean;
|
|
664
|
-
}): Promise<{
|
|
665
|
-
tasks: TaskDefinition[];
|
|
666
|
-
variables?: VariableDefinition[];
|
|
667
|
-
prompts?: PromptDefinition[];
|
|
668
|
-
enabled?: EnabledValue;
|
|
669
|
-
templates?: TasksConfiguration[];
|
|
670
|
-
transformers?: Transformer[];
|
|
671
|
-
}>;
|
|
672
|
-
//#endregion
|
|
673
|
-
//#region src/template-utils.d.ts
|
|
674
|
-
/**
|
|
675
|
-
* Configuration for template/templateFile properties
|
|
676
|
-
*/
|
|
677
|
-
interface TemplateSource {
|
|
678
|
-
template?: string;
|
|
679
|
-
templateFile?: string;
|
|
680
|
-
}
|
|
681
|
-
/**
|
|
682
|
-
* Result of template validation
|
|
683
|
-
*/
|
|
684
|
-
interface TemplateValidationResult {
|
|
685
|
-
isValid: boolean;
|
|
686
|
-
hasInlineTemplate: boolean;
|
|
687
|
-
hasTemplateFile: boolean;
|
|
688
|
-
error?: string;
|
|
689
|
-
}
|
|
690
|
-
/**
|
|
691
|
-
* Options for processing templates
|
|
692
|
-
*/
|
|
693
|
-
interface ProcessTemplateOptions {
|
|
694
|
-
/** Enable Handlebars compilation for .hbs files */
|
|
695
|
-
enableHandlebars?: boolean;
|
|
696
|
-
/** Source URL for resolving relative template paths */
|
|
697
|
-
sourceUrl?: string;
|
|
698
|
-
}
|
|
699
|
-
/**
|
|
700
|
-
* Check if a config has an inline template
|
|
701
|
-
* @param config - Configuration object with potential template property
|
|
702
|
-
* @returns True if inline template is present and non-empty
|
|
703
|
-
*/
|
|
704
|
-
declare function hasInlineTemplate(config: TemplateSource): boolean;
|
|
705
|
-
/**
|
|
706
|
-
* Check if a config has a template file reference
|
|
707
|
-
* @param config - Configuration object with potential templateFile property
|
|
708
|
-
* @returns True if templateFile is present and non-empty
|
|
709
|
-
*/
|
|
710
|
-
declare function hasTemplateFile(config: TemplateSource): boolean;
|
|
711
|
-
/**
|
|
712
|
-
* Check if a template file should be processed with Handlebars
|
|
713
|
-
* @param templateFile - Path to the template file
|
|
714
|
-
* @returns True if the file has .hbs extension
|
|
715
|
-
*/
|
|
716
|
-
declare function shouldUseHandlebars(templateFile: string): boolean;
|
|
717
|
-
/**
|
|
718
|
-
* Validate template configuration
|
|
719
|
-
* @param config - Configuration object to validate
|
|
720
|
-
* @returns Validation result with details
|
|
721
|
-
*/
|
|
722
|
-
declare function validateTemplateConfig(config: TemplateSource): TemplateValidationResult;
|
|
723
|
-
/**
|
|
724
|
-
* Process a template and return the rendered content
|
|
725
|
-
* @param config - Template configuration
|
|
726
|
-
* @param initConfig - Initialization config with variable values
|
|
727
|
-
* @param task - Optional task definition for $sourceUrl resolution
|
|
728
|
-
* @param options - Processing options
|
|
729
|
-
* @returns Processed template content
|
|
730
|
-
*/
|
|
731
|
-
declare function processTemplate(config: TemplateSource, initConfig: InitConfig, task?: TaskDefinition, options?: ProcessTemplateOptions): Promise<string>;
|
|
732
|
-
/**
|
|
733
|
-
* Get a description of the template source for display purposes
|
|
734
|
-
* @param config - Template configuration
|
|
735
|
-
* @returns Human-readable description of the template source
|
|
736
|
-
*/
|
|
737
|
-
declare function getTemplateSourceDescription(config: TemplateSource): string;
|
|
738
|
-
//#endregion
|
|
739
|
-
//#region src/variables/collect-variables.d.ts
|
|
740
|
-
/**
|
|
741
|
-
* Collect variable values from resolved variables
|
|
742
|
-
* Variables don't require user interaction - they're just resolved from static
|
|
743
|
-
* values or executable commands
|
|
744
|
-
*
|
|
745
|
-
* @param variables - Array of variable definitions
|
|
746
|
-
* @param resolvedValues - Map of pre-resolved variable values
|
|
747
|
-
* @param context - Current configuration context (for transformer evaluation)
|
|
748
|
-
* @returns Object mapping variable IDs to their values
|
|
749
|
-
*/
|
|
750
|
-
declare function collectVariables(variables: VariableDefinition[], resolvedValues?: Map<string, unknown>, context?: InitConfig): Promise<Record<string, unknown>>;
|
|
751
|
-
//#endregion
|
|
752
|
-
//#region src/variables/resolve-all-variable-values.d.ts
|
|
753
|
-
/**
|
|
754
|
-
* Resolve all variable values sequentially to allow lazy evaluation of template enabled conditions
|
|
755
|
-
* Each variable can access values from previous variables and prompts
|
|
756
|
-
* @param variables - Array of variable definitions
|
|
757
|
-
* @param context - Optional context for evaluating conditional variables
|
|
758
|
-
* @param options - Optional resolution options
|
|
759
|
-
* @param options.skipConditional - If true, skip conditional variables (they will be resolved later)
|
|
760
|
-
* @returns Map of variable IDs to their resolved values
|
|
761
|
-
*/
|
|
762
|
-
declare function resolveAllVariableValues(variables: VariableDefinition[], context?: InitConfig, options?: {
|
|
763
|
-
skipConditional?: boolean;
|
|
764
|
-
}): Promise<Map<string, unknown>>;
|
|
765
|
-
//#endregion
|
|
766
|
-
//#region src/variables/resolve-variable-value.d.ts
|
|
767
|
-
/**
|
|
768
|
-
* Resolve a variable value that may be static, executable, or conditional
|
|
769
|
-
* @param value - The variable value configuration
|
|
770
|
-
* @param variableId - The variable ID for error reporting
|
|
771
|
-
* @param context - Optional context for evaluating conditional values
|
|
772
|
-
* @param sourceUrl - Optional source URL for resolving relative file paths in exec-file
|
|
773
|
-
* @returns The resolved variable value
|
|
774
|
-
*/
|
|
775
|
-
declare function resolveVariableValue<T = string | number | boolean>(value: DefaultValue<T>, variableId: string, context?: InitConfig, sourceUrl?: string): Promise<T | undefined>;
|
|
776
|
-
//#endregion
|
|
777
|
-
//#region src/variables/validate-variables.d.ts
|
|
778
|
-
/**
|
|
779
|
-
* Validate variable definitions for duplicate IDs
|
|
780
|
-
* @param variables - Array of variable definitions to validate
|
|
781
|
-
* @returns Array of error messages (empty if no errors)
|
|
782
|
-
*/
|
|
783
|
-
declare function validateVariables(variables: VariableDefinition[]): string[];
|
|
784
|
-
//#endregion
|
|
785
553
|
//#region src/index.d.ts
|
|
786
|
-
/**
|
|
787
|
-
* Main function for executing tasks with default/empty tasks array
|
|
788
|
-
* For most use cases, you should use runWithTasks() with your custom tasks
|
|
789
|
-
*/
|
|
790
|
-
declare function main(customTasks?: TaskDefinition[]): Promise<void>;
|
|
791
554
|
/**
|
|
792
555
|
* Execute tasks with custom task definitions
|
|
793
556
|
* @param customTasks - Array of task definitions to execute
|
|
794
557
|
* @param options - Optional configuration
|
|
795
558
|
* @param options.dryRun - Preview changes without applying them
|
|
796
559
|
* @param options.force - Force execution even if checks fail
|
|
797
|
-
* @param options.
|
|
560
|
+
* @param options.configFilePath - Path to the tasks file
|
|
798
561
|
* @param options.variables - Optional top-level global variables
|
|
799
562
|
* @param options.prompts - Optional top-level global prompts
|
|
800
|
-
* @param options.
|
|
563
|
+
* @param options.configEnabled - Optional config-level enabled condition
|
|
801
564
|
* @param options.transformers - Optional transformer definitions
|
|
802
565
|
*/
|
|
803
566
|
declare function runWithTasks(customTasks: TaskDefinition[], options?: {
|
|
804
567
|
dryRun?: boolean | undefined;
|
|
805
568
|
force?: boolean | undefined;
|
|
806
|
-
|
|
569
|
+
configFilePath?: string | undefined;
|
|
807
570
|
variables?: VariableDefinition[] | undefined;
|
|
808
571
|
prompts?: PromptDefinition[] | undefined;
|
|
809
|
-
|
|
572
|
+
configEnabled?: EnabledValue | undefined;
|
|
810
573
|
transformers?: Transformer[] | undefined;
|
|
811
574
|
}): Promise<void>;
|
|
812
575
|
//#endregion
|
|
813
|
-
export { type AppendConfig, BasePrompt, ConditionExpression, ConditionalConfig, ConditionalDefaultConfig, ConfirmPrompt, type CopyConfig, type CreateConfig, DefaultValue, DefaultValueConfig, DefaultValueType, type DeleteConfig, DynamicBooleanValue, EnabledValue, type ExecConfig, ExecFileRuntime, ExecFileValueConfig, ExecutableConfig, type GitInitConfig, InitConfig, InputPrompt, MergeStrategy, type MkdirConfig, type MoveConfig, NumberPrompt, PluginHooks, PromptDefinition, PromptType, type RegexReplaceConfig, type RenameConfig, type ReplaceInFileConfig, RollbackConfig, SelectPrompt, TaskDefinition, TaskPlugin, TaskType, TasksConfiguration, type UpdateJsonConfig, VariableDefinition, type WriteConfig,
|
|
576
|
+
export { type AppendConfig, BasePrompt, ConditionExpression, ConditionalConfig, ConditionalDefaultConfig, ConfirmPrompt, type CopyConfig, type CreateConfig, DefaultValue, DefaultValueConfig, DefaultValueType, type DeleteConfig, DynamicBooleanValue, EnabledValue, type ExecConfig, ExecFileRuntime, ExecFileValueConfig, ExecutableConfig, type GitInitConfig, InitConfig, InputPrompt, MergeStrategy, type MkdirConfig, type MoveConfig, NumberPrompt, PluginHooks, PromptDefinition, PromptType, type RegexReplaceConfig, type RenameConfig, type ReplaceInFileConfig, RollbackConfig, SelectPrompt, TaskDefinition, TaskPlugin, TaskType, TasksConfiguration, type UpdateJsonConfig, VariableDefinition, type WriteConfig, clearConfigurationCache, clearPlugins, createTaskPlugin, displayTasksDiff, executePluginTask, getDeleteDiff, getExecDiff, getGitInitDiff, getPlugin, getPluginForTaskType, getRegexReplaceDiff, getRenameDiff, getReplaceInFileDiff, getTaskDiff, getUpdateJsonDiff, isPluginTaskType, listPlugins, loadAndMergeConfiguration, loadConfiguration, loadTasksWithInheritance, mergeConfigurations, registerHooks, registerPlugin, runWithTasks, unregisterPlugin, validateScaffoldfyJsonFile };
|