opencode-work-context 0.12.0 → 0.12.1
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 +3 -3
- package/bin/opencode-work-context.js +11 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -299,9 +299,9 @@ For an existing JSONC configuration, add the equivalent entry manually:
|
|
|
299
299
|
}
|
|
300
300
|
```
|
|
301
301
|
|
|
302
|
-
Re-running `activate`
|
|
303
|
-
|
|
304
|
-
|
|
302
|
+
Re-running `activate` or `deactivate` migrates every entry from the unsupported
|
|
303
|
+
legacy `plugins` field into the canonical `plugin` array, preserves entry order,
|
|
304
|
+
removes exact duplicates, and deletes `plugins`.
|
|
305
305
|
|
|
306
306
|
Update managed activation from one activated project with an exact version:
|
|
307
307
|
|
|
@@ -197,11 +197,17 @@ function activate(enabled, force) {
|
|
|
197
197
|
|| item.startsWith(`${packageManifest.name}@`)
|
|
198
198
|
|| item === "-work-context"
|
|
199
199
|
);
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
200
|
+
const seenPluginEntries = new Set();
|
|
201
|
+
config.plugin = [...(config.plugin || []), ...(config.plugins || [])]
|
|
202
|
+
.filter((item) => !isWorkContextEntry(item))
|
|
203
|
+
.filter((item) => {
|
|
204
|
+
const key = JSON.stringify(item);
|
|
205
|
+
if (seenPluginEntries.has(key)) return false;
|
|
206
|
+
seenPluginEntries.add(key);
|
|
207
|
+
return true;
|
|
208
|
+
});
|
|
209
|
+
config.plugin.push(entry);
|
|
210
|
+
delete config.plugins;
|
|
205
211
|
managedTuiConfig.plugin = [...(managedTuiConfig.plugin || []).filter((item) => !isWorkContextEntry(item)), entry];
|
|
206
212
|
const files = new Map([
|
|
207
213
|
[configRelative, JSON.stringify(config, null, 2) + "\n"],
|