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

Commit

Permalink
fix: don't delete @nbundle/cli from template
Browse files Browse the repository at this point in the history
  • Loading branch information
phuctm97 committed Jun 13, 2022
1 parent 20033b6 commit 05fe4bd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -60,6 +60,7 @@
"tar": "^6.1.11",
"ts-loader": "^9.3.0",
"tsconfig-paths-webpack-plugin": "^3.5.2",
"typescript": "^4.7.3",
"webpack": "^5.73.0",
"webpack-cli": "^4.9.2"
}
Expand Down
6 changes: 5 additions & 1 deletion src/utils/format-project.ts
Expand Up @@ -22,7 +22,11 @@ export async function formatProject(projectDirectory: string): Promise<void> {
const pkg = JSON.parse(await fs.readFile(pkgJsonPath, "utf8"));
pkg.name = name;
pkg.productName = name;
if (pkg.devDependencies) delete pkg.devDependencies;
pkg.devDependencies = Object.fromEntries(
Object.entries(pkg.devDependencies).filter(([key]) =>
key.startsWith("@nbundle/")
)
);
if (pkg.scripts.prepare) delete pkg.scripts.prepare;
await fs.writeFile(pkgJsonPath, JSON.stringify(pkg, null, 2), "utf8");
}
2 changes: 1 addition & 1 deletion yarn.lock
Expand Up @@ -5242,7 +5242,7 @@ typedarray-to-buffer@^3.1.5:
dependencies:
is-typedarray "^1.0.0"

typescript@^4.6.4:
typescript@^4.6.4, typescript@^4.7.3:
version "4.7.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.7.3.tgz#8364b502d5257b540f9de4c40be84c98e23a129d"
integrity sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==
Expand Down

0 comments on commit 05fe4bd

Please sign in to comment.