@create-node-app/core 0.3.4 → 0.3.5
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 +24 -8
- package/dist/index.mjs +24 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -790,10 +790,10 @@ var run = async ({
|
|
|
790
790
|
}
|
|
791
791
|
} else {
|
|
792
792
|
console.log(import_chalk3.default.yellow("Skip package installation."));
|
|
793
|
-
const
|
|
793
|
+
const packageJson2 = JSON.parse(
|
|
794
794
|
import_fs5.default.readFileSync(`${root}/package.json`, "utf8")
|
|
795
795
|
);
|
|
796
|
-
|
|
796
|
+
packageJson2.dependencies = dependencies.reduce((dep, elem) => {
|
|
797
797
|
const nextDep = dep;
|
|
798
798
|
if (/.+@(\^|~)?[0-9a-zA-Z-.]+$/.test(elem)) {
|
|
799
799
|
const [name, version] = elem.split("@");
|
|
@@ -803,7 +803,7 @@ var run = async ({
|
|
|
803
803
|
}
|
|
804
804
|
return nextDep;
|
|
805
805
|
}, {});
|
|
806
|
-
|
|
806
|
+
packageJson2.devDependencies = devDependencies.reduce((dep, elem) => {
|
|
807
807
|
const nextDep = dep;
|
|
808
808
|
if (/.+@(\^|~)?[0-9a-zA-Z-.]+$/.test(elem)) {
|
|
809
809
|
const [name, version] = elem.split("@");
|
|
@@ -815,7 +815,7 @@ var run = async ({
|
|
|
815
815
|
}, {});
|
|
816
816
|
import_fs5.default.writeFileSync(
|
|
817
817
|
import_path4.default.join(root, "package.json"),
|
|
818
|
-
JSON.stringify(
|
|
818
|
+
JSON.stringify(packageJson2, null, 2) + import_os3.default.EOL
|
|
819
819
|
);
|
|
820
820
|
console.log();
|
|
821
821
|
console.log(import_chalk3.default.green("Successfully updated package.json."));
|
|
@@ -831,10 +831,10 @@ var run = async ({
|
|
|
831
831
|
"Failed to initialize git repository. Run `git init` to initialize git repository after the process is completed."
|
|
832
832
|
);
|
|
833
833
|
if (installDependencies && isOnline) {
|
|
834
|
-
const
|
|
834
|
+
const packageJson2 = JSON.parse(
|
|
835
835
|
import_fs5.default.readFileSync(`${root}/package.json`, "utf8")
|
|
836
836
|
);
|
|
837
|
-
if (
|
|
837
|
+
if (packageJson2.scripts && packageJson2.scripts["format"]) {
|
|
838
838
|
try {
|
|
839
839
|
await runCommandInProjectDir(
|
|
840
840
|
root,
|
|
@@ -846,7 +846,7 @@ var run = async ({
|
|
|
846
846
|
} catch {
|
|
847
847
|
}
|
|
848
848
|
}
|
|
849
|
-
if (
|
|
849
|
+
if (packageJson2.scripts && packageJson2.scripts["lint:fix"]) {
|
|
850
850
|
try {
|
|
851
851
|
await runCommandInProjectDir(
|
|
852
852
|
root,
|
|
@@ -861,7 +861,23 @@ var run = async ({
|
|
|
861
861
|
}
|
|
862
862
|
console.log();
|
|
863
863
|
console.log(import_chalk3.default.green("Successfully created project " + appName + "."));
|
|
864
|
-
|
|
864
|
+
console.log();
|
|
865
|
+
console.log("Done! Now run:");
|
|
866
|
+
console.log();
|
|
867
|
+
console.log(import_chalk3.default.cyan(` cd ${appName}`));
|
|
868
|
+
console.log(import_chalk3.default.cyan(` ${installCommand}`));
|
|
869
|
+
const packageJson = JSON.parse(
|
|
870
|
+
import_fs5.default.readFileSync(`${root}/package.json`, "utf8")
|
|
871
|
+
);
|
|
872
|
+
const lookForScripts = ["sls:offline", "dev", "start"];
|
|
873
|
+
for (const script of lookForScripts) {
|
|
874
|
+
if (packageJson.scripts && packageJson.scripts[script]) {
|
|
875
|
+
console.log(import_chalk3.default.cyan(` ${runCommand} ${script}`));
|
|
876
|
+
break;
|
|
877
|
+
}
|
|
878
|
+
}
|
|
879
|
+
console.log();
|
|
880
|
+
console.log(import_chalk3.default.green("Happy hacking!"));
|
|
865
881
|
};
|
|
866
882
|
var createApp = async ({
|
|
867
883
|
name,
|
package/dist/index.mjs
CHANGED
|
@@ -761,10 +761,10 @@ var run = async ({
|
|
|
761
761
|
}
|
|
762
762
|
} else {
|
|
763
763
|
console.log(chalk3.yellow("Skip package installation."));
|
|
764
|
-
const
|
|
764
|
+
const packageJson2 = JSON.parse(
|
|
765
765
|
fs4.readFileSync(`${root}/package.json`, "utf8")
|
|
766
766
|
);
|
|
767
|
-
|
|
767
|
+
packageJson2.dependencies = dependencies.reduce((dep, elem) => {
|
|
768
768
|
const nextDep = dep;
|
|
769
769
|
if (/.+@(\^|~)?[0-9a-zA-Z-.]+$/.test(elem)) {
|
|
770
770
|
const [name, version] = elem.split("@");
|
|
@@ -774,7 +774,7 @@ var run = async ({
|
|
|
774
774
|
}
|
|
775
775
|
return nextDep;
|
|
776
776
|
}, {});
|
|
777
|
-
|
|
777
|
+
packageJson2.devDependencies = devDependencies.reduce((dep, elem) => {
|
|
778
778
|
const nextDep = dep;
|
|
779
779
|
if (/.+@(\^|~)?[0-9a-zA-Z-.]+$/.test(elem)) {
|
|
780
780
|
const [name, version] = elem.split("@");
|
|
@@ -786,7 +786,7 @@ var run = async ({
|
|
|
786
786
|
}, {});
|
|
787
787
|
fs4.writeFileSync(
|
|
788
788
|
path3.join(root, "package.json"),
|
|
789
|
-
JSON.stringify(
|
|
789
|
+
JSON.stringify(packageJson2, null, 2) + os3.EOL
|
|
790
790
|
);
|
|
791
791
|
console.log();
|
|
792
792
|
console.log(chalk3.green("Successfully updated package.json."));
|
|
@@ -802,10 +802,10 @@ var run = async ({
|
|
|
802
802
|
"Failed to initialize git repository. Run `git init` to initialize git repository after the process is completed."
|
|
803
803
|
);
|
|
804
804
|
if (installDependencies && isOnline) {
|
|
805
|
-
const
|
|
805
|
+
const packageJson2 = JSON.parse(
|
|
806
806
|
fs4.readFileSync(`${root}/package.json`, "utf8")
|
|
807
807
|
);
|
|
808
|
-
if (
|
|
808
|
+
if (packageJson2.scripts && packageJson2.scripts["format"]) {
|
|
809
809
|
try {
|
|
810
810
|
await runCommandInProjectDir(
|
|
811
811
|
root,
|
|
@@ -817,7 +817,7 @@ var run = async ({
|
|
|
817
817
|
} catch {
|
|
818
818
|
}
|
|
819
819
|
}
|
|
820
|
-
if (
|
|
820
|
+
if (packageJson2.scripts && packageJson2.scripts["lint:fix"]) {
|
|
821
821
|
try {
|
|
822
822
|
await runCommandInProjectDir(
|
|
823
823
|
root,
|
|
@@ -832,7 +832,23 @@ var run = async ({
|
|
|
832
832
|
}
|
|
833
833
|
console.log();
|
|
834
834
|
console.log(chalk3.green("Successfully created project " + appName + "."));
|
|
835
|
-
|
|
835
|
+
console.log();
|
|
836
|
+
console.log("Done! Now run:");
|
|
837
|
+
console.log();
|
|
838
|
+
console.log(chalk3.cyan(` cd ${appName}`));
|
|
839
|
+
console.log(chalk3.cyan(` ${installCommand}`));
|
|
840
|
+
const packageJson = JSON.parse(
|
|
841
|
+
fs4.readFileSync(`${root}/package.json`, "utf8")
|
|
842
|
+
);
|
|
843
|
+
const lookForScripts = ["sls:offline", "dev", "start"];
|
|
844
|
+
for (const script of lookForScripts) {
|
|
845
|
+
if (packageJson.scripts && packageJson.scripts[script]) {
|
|
846
|
+
console.log(chalk3.cyan(` ${runCommand} ${script}`));
|
|
847
|
+
break;
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
console.log();
|
|
851
|
+
console.log(chalk3.green("Happy hacking!"));
|
|
836
852
|
};
|
|
837
853
|
var createApp = async ({
|
|
838
854
|
name,
|