-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(gatsby): officially stop supporting Node 6 (#14842)
* ci: remove node6 unit test running * refactor(gatsby-cli): fail on Node 6 * feat(babel-preset-gatsby-package): nodeVersion is supported option * chore: update documentation and lockfile * chore: remove the workflow too ya dingus * chore: use engines in gatsby-cli * chore: fix pkg engines * chore: migrate off of engines * chore(*): add engines to all packages * chore: does this work * chore: add new lines
- Loading branch information
Showing
105 changed files
with
403 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
{ | ||
"presets": [ | ||
["babel-preset-gatsby-package"] | ||
["babel-preset-gatsby-package", { | ||
"nodeVersion": "6.0" | ||
}] | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
jest.mock(`../reporter`, () => { | ||
return { | ||
panic: jest.fn(), | ||
log: jest.fn(), | ||
stripIndent: jest.fn(str => str), | ||
} | ||
}) | ||
jest.mock(`../create-cli`) | ||
|
||
const getCLI = () => { | ||
jest.resetModules() | ||
|
||
const reporter = require(`../reporter`) | ||
const createCLI = require(`../create-cli`) | ||
|
||
require(`../`) | ||
|
||
return { | ||
reporter, | ||
createCLI, | ||
} | ||
} | ||
|
||
let __process__ | ||
beforeAll(() => { | ||
__process__ = global.process | ||
}) | ||
|
||
beforeEach(() => { | ||
global.process = __process__ | ||
}) | ||
|
||
const setup = version => { | ||
if (version) { | ||
Object.defineProperty(__process__, `version`, { | ||
get: () => version, | ||
}) | ||
} | ||
|
||
return getCLI() | ||
} | ||
|
||
describe(`error handling`, () => { | ||
it(`panics on Node < 8.0.0`, () => { | ||
const { reporter } = setup(`v6.0.0`) | ||
|
||
expect(reporter.panic).toHaveBeenCalledTimes(1) | ||
}) | ||
|
||
it(`shows error with link to more info`, () => { | ||
const { reporter } = setup(`v6.0.0`) | ||
|
||
expect(reporter.panic).toHaveBeenCalledWith( | ||
expect.stringContaining(`https://gatsby.dev/upgrading-node-js`) | ||
) | ||
}) | ||
}) | ||
|
||
describe(`normal behavior`, () => { | ||
it(`does not panic on Node >= 8.0.0`, () => { | ||
;[`8.0.0`, `8.9.0`, `10.0.0`, `11.0.0`, `12.0.0`].forEach(version => { | ||
const { reporter } = setup(version) | ||
|
||
expect(reporter.panic).not.toHaveBeenCalled() | ||
}) | ||
}) | ||
|
||
it(`invokes createCLI`, () => { | ||
const { createCLI } = setup() | ||
|
||
expect(createCLI).toHaveBeenCalledTimes(1) | ||
expect(createCLI).toHaveBeenCalledWith(process.argv) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,5 +33,8 @@ | |
}, | ||
"peerDependencies": { | ||
"gatsby": "^2.0.0" | ||
}, | ||
"engines": { | ||
"node": ">=8.0.0" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.