5.9 KiB
phase, plan, type, wave, depends_on, files_modified, autonomous, requirements, must_haves
| phase | plan | type | wave | depends_on | files_modified | autonomous | requirements | must_haves | ||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 02-generators | 02 | execute | 2 |
|
|
true |
|
|
Purpose: CONF-01 — the foundational output artifact. Every downstream phase depends on this being correct. Wrong type values or included empty fields silently break rclone remotes. Output: src/generators/rclone-conf.ts with all rclone-conf.test.ts assertions green.
<execution_context> @C:/Users/SebastienQUEROL/.claude/get-shit-done/workflows/execute-plan.md @C:/Users/SebastienQUEROL/.claude/get-shit-done/templates/summary.md </execution_context>
@.planning/ROADMAP.md @.planning/phases/02-generators/02-01-SUMMARY.md @src/store/types.ts @src/schemas/registry.ts @src/generators/rclone-conf.test.tsFrom src/store/types.ts:
export interface WizardState {
currentStep: number;
remote: {
name: string;
backendType: BackendType | null; // null must throw
params: Record<string, string>; // iterate, skip empty values
};
deployment: {
includeInstall: boolean;
configPath: 'machine-wide' | 'user-profile';
scriptTargets: ('intune' | 'rmm')[];
};
}
From src/schemas/registry.ts:
export type BackendType = 'azureblob' | 's3' | 's3-compatible';
Critical type mapping (from research — verified against rclone.org):
// BackendType → rclone config 'type' value
// 'azureblob' → 'azureblob'
// 's3' → 's3'
// 's3-compatible' → 's3' (NOT 's3-compatible' — rclone does not recognize that string)
// S3-compatible backends use type = s3, differentiated by provider = Other
Follow this exact structure:
```typescript
import type { WizardState } from '../store/types';
// Maps our BackendType to rclone's internal type string.
// IMPORTANT: s3-compatible uses 'type = s3' — rclone does not recognize 's3-compatible' as a type.
// S3-compatible backends are differentiated by provider = Other in params.
const RCLONE_TYPE_MAP: Record<string, string> = {
azureblob: 'azureblob',
s3: 's3',
's3-compatible': 's3',
};
export function buildRcloneConf(state: WizardState): string {
const { name, backendType, params } = state.remote;
if (!backendType) throw new Error('buildRcloneConf: backendType is required');
if (!name) throw new Error('buildRcloneConf: remote name is required');
const rcloneType = RCLONE_TYPE_MAP[backendType];
const lines: string[] = [`[${name}]`, `type = ${rcloneType}`];
for (const [key, value] of Object.entries(params)) {
if (value !== '') {
lines.push(`${key} = ${value}`);
}
}
return lines.join('\n') + '\n';
}
```
Do NOT import BACKEND_REGISTRY — the function iterates over state.remote.params directly (already contains the right keys from the registry-driven form). Do NOT add any console.log or Write-Host equivalent — credentials must not be logged.
Anti-pattern to avoid: Do not write `type = s3-compatible`. The RCLONE_TYPE_MAP lookup handles the translation.
<success_criteria> CONF-01 is satisfied: buildRcloneConf produces valid INI-format rclone.conf strings with correct key/value pairs for all three supported backends (azureblob, s3, s3-compatible). </success_criteria>
After completion, create `.planning/phases/02-generators/02-02-SUMMARY.md`