Skip to content

Commit

Permalink
chore: more cleanup after Node 8 drop (#20343)
Browse files Browse the repository at this point in the history
* chore: stop supporting Node 8

Node.js v8 is scheduled to stop maintenance on December 2019.
Please see https://nodejs.org/en/about/releases/

* fix: lowest support Node version is v10.13.0

* fix: revert yarn.lock

* we don't need conditional testInNode8OrHigher jest utility

* no unneeded changes

Co-authored-by: Michal Piechowiak <[email protected]>
  • Loading branch information
shisama and pieh authored Mar 20, 2020
1 parent a39f6bf commit 8aeb303
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ jobs:
- <<: *install_node_modules
- <<: *persist_cache
# persist our git checkout and node_modules as the next step (assert-changed-files) might exit this step
# when no files have changed (master). We still need to have these files for jobs like lint & unit_tests_node8
# when no files have changed (master). We still need to have these files for jobs like lint & unit_tests_node10
- persist_to_workspace:
root: ./
paths:
Expand Down
2 changes: 1 addition & 1 deletion packages/babel-preset-gatsby-package/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ Outputs the targets/plugins used and the version specified in [plugin data versi

### `nodeVersion`

`string`, defaults to `8.0`
`string`, defaults to `10.13`

Allows the Node.js version target to be modified per [`@babel/preset-env` documentation](https://babeljs.io/docs/en/babel-preset-env#targetsnode)
3 changes: 1 addition & 2 deletions packages/gatsby-remark-copy-linked-files/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@
"babel-preset-gatsby-package": "^0.3.0",
"cross-env": "^5.2.1",
"remark": "^10.0.1",
"remark-mdx": "^1.5.7",
"semver": "^6.3.0"
"remark-mdx": "^1.5.7"
},
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-copy-linked-files#readme",
"keywords": [
Expand Down
12 changes: 1 addition & 11 deletions packages/gatsby-remark-copy-linked-files/src/__tests__/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ jest.mock(`fs-extra`, () => {
const Remark = require(`remark`)
const fsExtra = require(`fs-extra`)
const path = require(`path`)
const semver = require(`semver`)

const plugin = require(`../`)

Expand All @@ -20,15 +19,6 @@ const remark = new Remark().data(`settings`, {

const imageURL = markdownAST => markdownAST.children[0].children[0].url

const testInNode8OrHigher = (title, ...args) => {
const isNode8OrHigher = semver.satisfies(process.version, `>=8`)
if (isNode8OrHigher) {
it(title, ...args)
} else {
it.skip(`skipped on Node 7 or lower: ${title}`, ...args)
}
}

describe(`gatsby-remark-copy-linked-files`, () => {
afterEach(() => {
fsExtra.copy.mockReset()
Expand Down Expand Up @@ -132,7 +122,7 @@ describe(`gatsby-remark-copy-linked-files`, () => {
expect(fsExtra.copy).toHaveBeenCalled()
})

testInNode8OrHigher(`can copy JSX images`, async () => {
it(`can copy JSX images`, async () => {
const mdx = require(`remark-mdx`)
const path = `images/sample-image.gif`

Expand Down
1 change: 0 additions & 1 deletion packages/gatsby-remark-responsive-iframe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"cross-env": "^5.2.1",
"remark": "^10.0.1",
"remark-mdx": "^1.5.7",
"semver": "^6.3.0",
"unist-util-find": "^1.0.1"
},
"homepage": "https://github.com/gatsbyjs/gatsby/tree/master/packages/gatsby-remark-responsive-iframe#readme",
Expand Down
12 changes: 1 addition & 11 deletions packages/gatsby-remark-responsive-iframe/src/__tests__/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
const Remark = require(`remark`)
const find = require(`unist-util-find`)
const _ = require(`lodash`)
const semver = require(`semver`)

const plugin = require(`../`)

const testInNode8OrHigher = (title, ...args) => {
const isNode8OrHigher = semver.satisfies(process.version, `>=8`)
if (isNode8OrHigher) {
it(title, ...args)
} else {
it.skip(`skipped on Node 7 or lower: ${title}`, ...args)
}
}

const remark = new Remark().data(`settings`, {
commonmark: true,
footnotes: true,
Expand Down Expand Up @@ -83,7 +73,7 @@ describe(`gatsby-remark-responsive-iframe`, () => {
})
})

testInNode8OrHigher(`can copy JSX images`, async () => {
it(`can copy JSX images`, async () => {
const mdx = require(`remark-mdx`)

const markdownAST = remark().use(mdx).parse(`
Expand Down

0 comments on commit 8aeb303

Please sign in to comment.