@elvis1513/auto-coding-skill 5.0.1 → 5.0.2
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/cli/assets/managed-install.json +1 -1
- package/cli/src/index.js +12 -4
- package/package.json +1 -1
package/cli/src/index.js
CHANGED
|
@@ -96,14 +96,22 @@ function isManaged(previous, relative) {
|
|
|
96
96
|
return Array.isArray(previous?.entries) && previous.entries.some(entry => entry?.path === relative && entry?.ownership === "managed");
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
+
function stripLegacyAccessConfiguration(text) {
|
|
100
|
+
return text.replace(/\n?## Migrated access configuration\s*\n```yaml\n[\s\S]*?\n```\s*/g, "\n").trim();
|
|
101
|
+
}
|
|
102
|
+
|
|
99
103
|
function migrateLegacyEnvironment(project) {
|
|
100
104
|
const previous = readManifest(project);
|
|
101
105
|
const environment = path.join(project, "docs", "ENVIRONMENT.md");
|
|
102
106
|
const projectConfig = path.join(project, "docs", "PROJECT.md");
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
.trim();
|
|
107
|
+
if (exists(projectConfig)) {
|
|
108
|
+
const existing = fs.readFileSync(projectConfig, "utf8");
|
|
109
|
+
const cleaned = stripLegacyAccessConfiguration(existing);
|
|
110
|
+
if (cleaned !== existing.trim()) fs.writeFileSync(projectConfig, `${cleaned}\n`);
|
|
111
|
+
return false;
|
|
112
|
+
}
|
|
113
|
+
if (!exists(environment) || isManaged(previous, "docs/ENVIRONMENT.md")) return false;
|
|
114
|
+
const legacy = stripLegacyAccessConfiguration(fs.readFileSync(environment, "utf8"));
|
|
107
115
|
if (!legacy) return false;
|
|
108
116
|
const template = fs.readFileSync(path.join(assetSkill, "data", "templates", "PROJECT.md"), "utf8").trimEnd();
|
|
109
117
|
mkdirFor(projectConfig);
|
package/package.json
CHANGED