@create-node-app/core 0.3.0 → 0.3.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/dist/index.js +31 -24
- package/dist/index.mjs +31 -24
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -701,18 +701,19 @@ var install = (root, useYarn = false, usePnpm = false, dependencies = [], verbos
|
|
|
701
701
|
});
|
|
702
702
|
});
|
|
703
703
|
};
|
|
704
|
-
var runCommandInProjectDir = (root, command, args = [], successMessage = "Operation completed successfully.", errorMessage = "Operation failed.") => {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
console.log(import_chalk3.default.red(errorMessage));
|
|
710
|
-
return;
|
|
711
|
-
}
|
|
712
|
-
console.log(import_chalk3.default.green(successMessage));
|
|
713
|
-
resolve();
|
|
704
|
+
var runCommandInProjectDir = async (root, command, args = [], successMessage = "Operation completed successfully.", errorMessage = "Operation failed.") => {
|
|
705
|
+
try {
|
|
706
|
+
(0, import_child_process3.execSync)(`${command} ${args.join(" ")}`, {
|
|
707
|
+
cwd: root,
|
|
708
|
+
stdio: "inherit"
|
|
714
709
|
});
|
|
715
|
-
|
|
710
|
+
console.log();
|
|
711
|
+
console.log(import_chalk3.default.green(successMessage));
|
|
712
|
+
} catch (error) {
|
|
713
|
+
console.log();
|
|
714
|
+
console.log(import_chalk3.default.red(errorMessage));
|
|
715
|
+
console.log();
|
|
716
|
+
}
|
|
716
717
|
};
|
|
717
718
|
var run = async ({
|
|
718
719
|
root,
|
|
@@ -834,21 +835,27 @@ var run = async ({
|
|
|
834
835
|
import_fs5.default.readFileSync(`${root}/package.json`, "utf8")
|
|
835
836
|
);
|
|
836
837
|
if (packageJson.scripts && packageJson.scripts["format"]) {
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
838
|
+
try {
|
|
839
|
+
await runCommandInProjectDir(
|
|
840
|
+
root,
|
|
841
|
+
runCommand,
|
|
842
|
+
["format"],
|
|
843
|
+
"Successfully formatted code."
|
|
844
|
+
);
|
|
845
|
+
} catch {
|
|
846
|
+
}
|
|
843
847
|
}
|
|
844
848
|
if (packageJson.scripts && packageJson.scripts["lint:fix"]) {
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
849
|
+
try {
|
|
850
|
+
await runCommandInProjectDir(
|
|
851
|
+
root,
|
|
852
|
+
runCommand,
|
|
853
|
+
["lint:fix"],
|
|
854
|
+
"Successfully fixed linting errors.",
|
|
855
|
+
"Failed to fix linting errors."
|
|
856
|
+
);
|
|
857
|
+
} catch {
|
|
858
|
+
}
|
|
852
859
|
}
|
|
853
860
|
}
|
|
854
861
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -672,18 +672,19 @@ var install = (root, useYarn = false, usePnpm = false, dependencies = [], verbos
|
|
|
672
672
|
});
|
|
673
673
|
});
|
|
674
674
|
};
|
|
675
|
-
var runCommandInProjectDir = (root, command, args = [], successMessage = "Operation completed successfully.", errorMessage = "Operation failed.") => {
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
console.log(chalk3.red(errorMessage));
|
|
681
|
-
return;
|
|
682
|
-
}
|
|
683
|
-
console.log(chalk3.green(successMessage));
|
|
684
|
-
resolve();
|
|
675
|
+
var runCommandInProjectDir = async (root, command, args = [], successMessage = "Operation completed successfully.", errorMessage = "Operation failed.") => {
|
|
676
|
+
try {
|
|
677
|
+
execSync2(`${command} ${args.join(" ")}`, {
|
|
678
|
+
cwd: root,
|
|
679
|
+
stdio: "inherit"
|
|
685
680
|
});
|
|
686
|
-
|
|
681
|
+
console.log();
|
|
682
|
+
console.log(chalk3.green(successMessage));
|
|
683
|
+
} catch (error) {
|
|
684
|
+
console.log();
|
|
685
|
+
console.log(chalk3.red(errorMessage));
|
|
686
|
+
console.log();
|
|
687
|
+
}
|
|
687
688
|
};
|
|
688
689
|
var run = async ({
|
|
689
690
|
root,
|
|
@@ -805,21 +806,27 @@ var run = async ({
|
|
|
805
806
|
fs4.readFileSync(`${root}/package.json`, "utf8")
|
|
806
807
|
);
|
|
807
808
|
if (packageJson.scripts && packageJson.scripts["format"]) {
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
809
|
+
try {
|
|
810
|
+
await runCommandInProjectDir(
|
|
811
|
+
root,
|
|
812
|
+
runCommand,
|
|
813
|
+
["format"],
|
|
814
|
+
"Successfully formatted code."
|
|
815
|
+
);
|
|
816
|
+
} catch {
|
|
817
|
+
}
|
|
814
818
|
}
|
|
815
819
|
if (packageJson.scripts && packageJson.scripts["lint:fix"]) {
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
820
|
+
try {
|
|
821
|
+
await runCommandInProjectDir(
|
|
822
|
+
root,
|
|
823
|
+
runCommand,
|
|
824
|
+
["lint:fix"],
|
|
825
|
+
"Successfully fixed linting errors.",
|
|
826
|
+
"Failed to fix linting errors."
|
|
827
|
+
);
|
|
828
|
+
} catch {
|
|
829
|
+
}
|
|
823
830
|
}
|
|
824
831
|
}
|
|
825
832
|
};
|