nexu-app 2.0.2 → 2.0.4
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/dist/index.js +20 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -825,6 +825,26 @@ async function update(options) {
|
|
|
825
825
|
process.exit(1);
|
|
826
826
|
}
|
|
827
827
|
const templateDir = getTemplateDir3();
|
|
828
|
+
const projectPkgFixPath = path4.join(projectDir, "package.json");
|
|
829
|
+
const projectPkgFix = fs4.readJsonSync(projectPkgFixPath);
|
|
830
|
+
if (!projectPkgFix.packageManager) {
|
|
831
|
+
const pm = detectPackageManager(projectDir);
|
|
832
|
+
const pmField = getPackageManagerField(pm);
|
|
833
|
+
if (pmField) {
|
|
834
|
+
projectPkgFix.packageManager = pmField;
|
|
835
|
+
fs4.writeJsonSync(projectPkgFixPath, projectPkgFix, { spaces: 2 });
|
|
836
|
+
log(`Added packageManager field: ${pmField}`, "info");
|
|
837
|
+
}
|
|
838
|
+
}
|
|
839
|
+
const preCommitFixPath = path4.join(projectDir, ".husky", "pre-commit");
|
|
840
|
+
if (fs4.existsSync(preCommitFixPath)) {
|
|
841
|
+
const preCommitContent = fs4.readFileSync(preCommitFixPath, "utf-8");
|
|
842
|
+
if (!preCommitContent.includes("COREPACK_ENABLE_STRICT")) {
|
|
843
|
+
fs4.writeFileSync(preCommitFixPath, `export COREPACK_ENABLE_STRICT=0
|
|
844
|
+
${preCommitContent}`);
|
|
845
|
+
log("Fixed husky pre-commit hook (added COREPACK_ENABLE_STRICT=0)", "info");
|
|
846
|
+
}
|
|
847
|
+
}
|
|
828
848
|
const updateAll = options.all || !options.packages && !options.config && !options.workflows && !options.services && !options.scripts && !options.dependencies;
|
|
829
849
|
const updateTargets = {
|
|
830
850
|
packages: updateAll || options.packages,
|
|
@@ -1133,15 +1153,6 @@ ${change.relativePath}:`));
|
|
|
1133
1153
|
}
|
|
1134
1154
|
fs4.writeJsonSync(projectPkgPath, projectPkg, { spaces: 2 });
|
|
1135
1155
|
}
|
|
1136
|
-
const preCommitPath = path4.join(projectDir, ".husky", "pre-commit");
|
|
1137
|
-
if (fs4.existsSync(preCommitPath)) {
|
|
1138
|
-
const preCommitContent = fs4.readFileSync(preCommitPath, "utf-8");
|
|
1139
|
-
if (!preCommitContent.includes("COREPACK_ENABLE_STRICT")) {
|
|
1140
|
-
fs4.writeFileSync(preCommitPath, `export COREPACK_ENABLE_STRICT=0
|
|
1141
|
-
${preCommitContent}`);
|
|
1142
|
-
log("Fixed husky pre-commit hook (added COREPACK_ENABLE_STRICT=0)", "info");
|
|
1143
|
-
}
|
|
1144
|
-
}
|
|
1145
1156
|
const summary = [];
|
|
1146
1157
|
if (appliedFiles > 0) summary.push(`${appliedFiles} files updated`);
|
|
1147
1158
|
if (deletedFilesCount > 0) summary.push(`${deletedFilesCount} files deleted`);
|