@sylphx/flow 1.4.2 → 1.4.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @sylphx/flow
2
2
 
3
+ ## 1.4.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Fix sync not actually updating files (CRITICAL):
8
+ - Installation was comparing content and skipping writes
9
+ - Even after deletion, files weren't updated if content "matched"
10
+ - Add force mode that always overwrites during sync
11
+ - Sync now properly updates all files regardless of content
12
+
3
13
  ## 1.4.2
4
14
 
5
15
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sylphx/flow",
3
- "version": "1.4.2",
3
+ "version": "1.4.3",
4
4
  "description": "AI-powered development workflow automation with autonomous loop mode and smart configuration",
5
5
  "type": "module",
6
6
  "bin": {
@@ -168,7 +168,7 @@ export async function installComponents(
168
168
  if (target.setupAgents && options.agents !== false) {
169
169
  const agentSpinner = quiet ? null : ora({ text: 'Installing agents', color: 'cyan' }).start();
170
170
  try {
171
- const agentResult = await target.setupAgents(process.cwd(), { ...options, quiet: true });
171
+ const agentResult = await target.setupAgents(process.cwd(), { ...options, quiet: true, force: options.clear });
172
172
  result.installed.agents = agentResult.count;
173
173
 
174
174
  if (agentSpinner) {
@@ -188,7 +188,7 @@ export async function installComponents(
188
188
  if (target.setupOutputStyles && options.outputStyles !== false) {
189
189
  const stylesSpinner = quiet ? null : ora({ text: 'Installing output styles', color: 'cyan' }).start();
190
190
  try {
191
- const stylesResult = await target.setupOutputStyles(process.cwd(), { ...options, quiet: true });
191
+ const stylesResult = await target.setupOutputStyles(process.cwd(), { ...options, quiet: true, force: options.clear });
192
192
  result.installed.outputStyles = stylesResult.count;
193
193
 
194
194
  if (stylesSpinner) {
@@ -216,7 +216,7 @@ export async function installComponents(
216
216
  if (target.setupRules && options.rules !== false) {
217
217
  const rulesSpinner = quiet ? null : ora({ text: 'Installing rules', color: 'cyan' }).start();
218
218
  try {
219
- const rulesResult = await target.setupRules(process.cwd(), { ...options, quiet: true });
219
+ const rulesResult = await target.setupRules(process.cwd(), { ...options, quiet: true, force: options.clear });
220
220
  result.installed.rules = rulesResult.count;
221
221
 
222
222
  if (rulesSpinner) {
@@ -247,7 +247,7 @@ export async function installComponents(
247
247
  color: 'cyan',
248
248
  }).start();
249
249
  try {
250
- const commandsResult = await target.setupSlashCommands(process.cwd(), { ...options, quiet: true });
250
+ const commandsResult = await target.setupSlashCommands(process.cwd(), { ...options, quiet: true, force: options.clear });
251
251
  result.installed.slashCommands = commandsResult.count;
252
252
 
253
253
  if (commandsSpinner) {
@@ -15,6 +15,8 @@ export interface InstallOptions extends CommonOptions {
15
15
  flatten?: boolean;
16
16
  /** Show progress messages */
17
17
  showProgress?: boolean;
18
+ /** Force overwrite without checking content (for sync) */
19
+ force?: boolean;
18
20
  }
19
21
 
20
22
  export type FileTransformFn = (content: string, sourcePath?: string) => Promise<string>;
@@ -122,10 +124,8 @@ export async function installToDirectory(
122
124
  let content = fs.readFileSync(sourcePath, 'utf8');
123
125
  content = await transform(content, file);
124
126
 
125
- const localProcessed = localInfo ? await transform(localInfo.content, file) : '';
126
- const contentChanged = !localInfo || localProcessed !== content;
127
-
128
- if (contentChanged) {
127
+ // Force mode: always overwrite without checking
128
+ if (options.force) {
129
129
  fs.writeFileSync(targetPath, content, 'utf8');
130
130
  results.push({
131
131
  file,
@@ -133,11 +133,24 @@ export async function installToDirectory(
133
133
  action: localInfo ? 'Updated' : 'Created',
134
134
  });
135
135
  } else {
136
- results.push({
137
- file,
138
- status: 'current',
139
- action: 'Already current',
140
- });
136
+ // Normal mode: check if content changed
137
+ const localProcessed = localInfo ? await transform(localInfo.content, file) : '';
138
+ const contentChanged = !localInfo || localProcessed !== content;
139
+
140
+ if (contentChanged) {
141
+ fs.writeFileSync(targetPath, content, 'utf8');
142
+ results.push({
143
+ file,
144
+ status: localInfo ? 'updated' : 'added',
145
+ action: localInfo ? 'Updated' : 'Created',
146
+ });
147
+ } else {
148
+ results.push({
149
+ file,
150
+ status: 'current',
151
+ action: 'Already current',
152
+ });
153
+ }
141
154
  }
142
155
  });
143
156