Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Commit

Permalink
fix(create): include dependencies in package.json even with --skip-in…
Browse files Browse the repository at this point in the history
…stall
  • Loading branch information
pmbanugo committed Feb 12, 2022
1 parent 76e45e7 commit fb90a5a
Showing 1 changed file with 11 additions and 20 deletions.
31 changes: 11 additions & 20 deletions source/commands/create-project.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import degit from "degit";
import { install as pkgInstall } from "pkg-install";
import { projectInstall } from "pkg-install";
import { join } from "path";
import { writeFile } from "fs/promises";

Expand Down Expand Up @@ -29,6 +29,12 @@ export async function createPkgJson(name: string) {
dev: "micro-dev",
deploy: "kazi deploy",
},
dependencies: {
micro: "^9.3.4",
},
devDependencies: {
"micro-dev": "^3.0.0",
},
};

await writeFile(
Expand All @@ -55,23 +61,8 @@ export const install = async (name: string, useYarn: boolean = false) => {
const pkgManager = useYarn ? "yarn" : "npm";
const dir = join(process.cwd(), name);

await pkgInstall(
{
micro: "^9.3.4",
},
{
cwd: dir,
prefer: pkgManager,
}
);
await pkgInstall(
{
"micro-dev": "^3.0.0",
},
{
cwd: dir,
prefer: pkgManager,
dev: true,
}
);
await projectInstall({
cwd: dir,
prefer: pkgManager,
});
};

0 comments on commit fb90a5a

Please sign in to comment.