Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(generator-single-spa): print project setup complete messages #387

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/rotten-impalas-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"generator-single-spa": patch
---

Restores the helpful output printed on project setup complete.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ module.exports = class SingleSpaAngularGenerator extends Generator {
}
}

async finished() {
async end() {
console.log(
chalk.bgWhite.black(
`Project setup complete!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -220,18 +220,16 @@ module.exports = class SingleSpaReactGenerator extends PnpmGenerator {
});
}
}
finished() {
this.on(`${this.options.packageManager}Install:end`, () => {
console.log(
chalk.bgWhite.black(`Project setup complete!
end() {
console.log(
chalk.bgWhite.black(`Project setup complete!
Steps to test your React single-spa application:
1. Run '${this.options.packageManager} start${
this.options.packageManager === "yarn" ? "" : " --"
} --port 8500'
this.options.packageManager === "yarn" ? "" : " --"
} --port 8500'
2. Go to http://single-spa-playground.org/playground/instant-test?name=@${
this.options.orgName
}/${this.options.projectName}&url=8500 to see it working!`)
);
});
this.options.orgName
}/${this.options.projectName}&url=8500 to see it working!`)
);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -214,18 +214,16 @@ module.exports = class SingleSpaRootConfigGenerator extends PnpmGenerator {
});
}
}
finished() {
this.on(`${this.options.packageManager}Install:end`, () => {
console.log(
chalk.bgWhite.black(`Project setup complete!
end() {
console.log(
chalk.bgWhite.black(`Project setup complete!
Run '${this.options.packageManager} start' to boot up your single-spa root config`)
);
);

if (this.options.layout) {
console.log(
`\nPlease report single-spa-layout issues and bugs on GitHub https://github.com/single-spa/single-spa-layout/issues/new`
);
}
});
if (this.options.layout) {
console.log(
`\nPlease report single-spa-layout issues and bugs on GitHub https://github.com/single-spa/single-spa-layout/issues/new`
);
}
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -166,16 +166,14 @@ module.exports = class SingleSpaSvelteGenerator extends PnpmGenerator {
});
}
}
finished() {
this.on(`${this.options.packageManager}Install:end`, () => {
const bwLog = (msg) => console.log(chalk.bgWhite.black(msg));
end() {
const bwLog = (msg) => console.log(chalk.bgWhite.black(msg));

bwLog("Project setup complete!");
bwLog("Steps to test your Svelte single-spa application:");
bwLog(`1. Run '${this.options.packageManager} start'`);
bwLog(
`2. Go to http://single-spa-playground.org/playground/instant-test?name=@${this.options.orgName}/${this.options.projectName}&url=5000 to see it working!`
);
});
bwLog("Project setup complete!");
bwLog("Steps to test your Svelte single-spa application:");
bwLog(`1. Run '${this.options.packageManager} start'`);
bwLog(
`2. Go to http://single-spa-playground.org/playground/instant-test?name=@${this.options.orgName}/${this.options.projectName}&url=5000 to see it working!`
);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -181,33 +181,29 @@ module.exports = class SingleSpaUtilModuleGenerator extends PnpmGenerator {
});
}
}
finished() {
this.on(`${this.options.packageManager}Install:end`, () => {
const coloredFinalInstructions = chalk.bgWhite.black;
console.log(coloredFinalInstructions("Project setup complete!"));
console.log(
coloredFinalInstructions("Steps to test your utility module:")
);
console.log(
coloredFinalInstructions(
`1. Run '${this.options.packageManager} start${
this.options.packageManager === "yarn" ? "" : " --"
} --port 8500'`
)
);
console.log(
coloredFinalInstructions(`2. Go to http://single-spa-playground.org`)
);
console.log(
coloredFinalInstructions(
`3. Run the following in the browser console: window.importMapOverrides.addOverride('@${this.options.orgName}/${this.options.projectName}', '8500')`
)
);
console.log(
coloredFinalInstructions(
`4. Run the following in the browser console: System.import('@${this.options.orgName}/${this.options.projectName}')`
)
);
});
end() {
const coloredFinalInstructions = chalk.bgWhite.black;
console.log(coloredFinalInstructions("Project setup complete!"));
console.log(coloredFinalInstructions("Steps to test your utility module:"));
console.log(
coloredFinalInstructions(
`1. Run '${this.options.packageManager} start${
this.options.packageManager === "yarn" ? "" : " --"
} --port 8500'`
)
);
console.log(
coloredFinalInstructions(`2. Go to http://single-spa-playground.org`)
);
console.log(
coloredFinalInstructions(
`3. Run the following in the browser console: window.importMapOverrides.addOverride('@${this.options.orgName}/${this.options.projectName}', '8500')`
)
);
console.log(
coloredFinalInstructions(
`4. Run the following in the browser console: System.import('@${this.options.orgName}/${this.options.projectName}')`
)
);
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ module.exports = class SingleSpaVueGenerator extends Generator {
}),
});
}
async finished() {
async end() {
const usedYarn = this.fs.exists(
path.resolve(this.options.dir, this.options.projectName, "yarn.lock")
);
Expand Down