Skip to content

Commit

Permalink
Add --skipInstall. Fix tests and typescript react-jsx (#299)
Browse files Browse the repository at this point in the history
* Fix tests and typescript react-jsx

* Add changeset
  • Loading branch information
joeldenning authored Jun 27, 2021
1 parent 0a485de commit 6c8ca4e
Show file tree
Hide file tree
Showing 20 changed files with 1,703 additions and 330 deletions.
5 changes: 5 additions & 0 deletions .changeset/lemon-crews-grab.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"generator-single-spa": minor
---

Support --skipInstall option
1 change: 1 addition & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ module.exports = {
testTimeout: 120000,
testRegex: "tests\\/e2e\\/.+test.js",
watchPathIgnorePatterns: ["<rootDir>/tests/fixtures/"],
globalSetup: "<rootDir>/tests/create-fixtures.js",
};
4 changes: 4 additions & 0 deletions packages/generator-single-spa/src/generator-single-spa.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ module.exports = class SingleSpaGenerator extends Generator {
type: String,
});

this.option("skipInstall", {
type: Boolean,
});

if (args.length > 0 && !this.options.dir) {
this.options.dir = args[0];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,14 @@ module.exports = class SingleSpaReactGenerator extends PnpmGenerator {
}
}
install() {
this.installDependencies({
npm: this.options.packageManager === "npm",
yarn: this.options.packageManager === "yarn",
pnpm: this.options.packageManager === "pnpm",
bower: false,
});
if (!this.skipInstall) {
this.installDependencies({
npm: this.options.packageManager === "npm",
yarn: this.options.packageManager === "yarn",
pnpm: this.options.packageManager === "pnpm",
bower: false,
});
}
}
finished() {
this.on(`${this.options.packageManager}Install:end`, () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"extends": "ts-config-single-spa",
"compilerOptions": {
"jsx": "react"
"jsx": "react-jsx"
},
"include": ["src/**/*", "node_modules/@types"],
"exclude": ["src/**/*.test*"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,12 +185,14 @@ module.exports = class SingleSpaRootConfigGenerator extends PnpmGenerator {
}
}
install() {
this.installDependencies({
npm: this.options.packageManager === "npm",
yarn: this.options.packageManager === "yarn",
pnpm: this.options.packageManager === "pnpm",
bower: false,
});
if (!this.skipInstall) {
this.installDependencies({
npm: this.options.packageManager === "npm",
yarn: this.options.packageManager === "yarn",
pnpm: this.options.packageManager === "pnpm",
bower: false,
});
}
}
finished() {
this.on(`${this.options.packageManager}Install:end`, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,14 @@ module.exports = class SingleSpaSvelteGenerator extends PnpmGenerator {
}
}
install() {
this.installDependencies({
npm: this.options.packageManager === "npm",
yarn: this.options.packageManager === "yarn",
pnpm: this.options.packageManager === "pnpm",
bower: false,
});
if (!this.skipInstall) {
this.installDependencies({
npm: this.options.packageManager === "npm",
yarn: this.options.packageManager === "yarn",
pnpm: this.options.packageManager === "pnpm",
bower: false,
});
}
}
finished() {
this.on(`${this.options.packageManager}Install:end`, () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,14 @@ module.exports = class SingleSpaUtilModuleGenerator extends PnpmGenerator {
}
}
install() {
this.installDependencies({
npm: this.options.packageManager === "npm",
yarn: this.options.packageManager === "yarn",
pnpm: this.options.packageManager === "pnpm",
bower: false,
});
if (!this.skipInstall) {
this.installDependencies({
npm: this.options.packageManager === "npm",
yarn: this.options.packageManager === "yarn",
pnpm: this.options.packageManager === "pnpm",
bower: false,
});
}
}
finished() {
this.on(`${this.options.packageManager}Install:end`, () => {
Expand Down
Loading

0 comments on commit 6c8ca4e

Please sign in to comment.