Skip to content
This repository has been archived by the owner on Oct 31, 2024. It is now read-only.

Commit

Permalink
fix(cli): error during project initialization (#1169)
Browse files Browse the repository at this point in the history
* fix(cli): error during project initialization

* fix(cli): initializing for stable version
  • Loading branch information
patzick authored Oct 9, 2020
1 parent 4d2a87a commit c8c47c0
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
3 changes: 2 additions & 1 deletion packages/cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ module.exports = {
case STAGES.STABLE:
default:
await run(
`yarn add -D ${coreDevPackages
// TODO: change to coreDevPackages before releasing 0.5.0 - https://github.com/DivanteLtd/shopware-pwa/issues/1168
`yarn add -D ${localCoreDevPackages
.map((dep) => `${dep}@latest`)
.join(" ")}`
);
Expand Down
23 changes: 13 additions & 10 deletions packages/cli/src/extensions/nuxt-extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,22 +111,25 @@ module.exports = (toolbox: GluegunToolbox) => {
*/
toolbox.updateNuxtPackageJson = async (stage) => {
await toolbox.patching.update("package.json", (config) => {
config.scripts = config.scripts || {};
config.scripts.lint = "prettier --write '*.{js,vue}'";
config.scripts.dev = "shopware-pwa dev";
config.scripts.build = "shopware-pwa build";

// update versions to canary
if (stage === STAGES.CANARY) {
Object.keys(config.dependencies).forEach((dependencyName) => {
if (dependencyName.includes("@shopware-pwa")) {
config.dependencies[dependencyName] = "canary";
}
});
Object.keys(config.devDependencies).forEach((dependencyName) => {
if (dependencyName.includes("@shopware-pwa")) {
config.devDependencies[dependencyName] = "canary";
}
});
config.dependencies &&
Object.keys(config.dependencies).forEach((dependencyName) => {
if (dependencyName.includes("@shopware-pwa")) {
config.dependencies[dependencyName] = "canary";
}
});
config.devDependencies &&
Object.keys(config.devDependencies).forEach((dependencyName) => {
if (dependencyName.includes("@shopware-pwa")) {
config.devDependencies[dependencyName] = "canary";
}
});
}

delete config.engines;
Expand Down

1 comment on commit c8c47c0

@vercel
Copy link

@vercel vercel bot commented on c8c47c0 Oct 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.