Skip to content

Commit

Permalink
update all
Browse files Browse the repository at this point in the history
  • Loading branch information
sitek94 committed Dec 24, 2020
1 parent bbddeb1 commit 367ad50
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 132 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ coverage
# Compiled binary addons (http://nodejs.org/api/addons.html)
build/Release

.netlify

# Dependency directory
# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git
node_modules
Expand Down
35 changes: 0 additions & 35 deletions gatsby-node.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
const fs = require('fs')
const path = require('path')
const {URL} = require('url')
const rimraf = require('rimraf')
const {spawnSync} = require('child_process')
const slugify = require('@sindresorhus/slugify')
const {createFilePath} = require('gatsby-source-filesystem')
const {zipFunctions} = require('@netlify/zip-it-and-ship-it')
const config = require('./config/website')

const onCreateWebpackConfig = ({actions}) => {
Expand Down Expand Up @@ -118,41 +114,10 @@ function onCreateMdxNode({node, getNode, actions}) {
})
}

const onPreBootstrap = () => {
if (process.env.gatsby_executing_command === 'develop') {
return
}
require('./other/load-cache')

const result = spawnSync(
'./node_modules/.bin/npm-run-all --parallel lint test:coverage',
{stdio: 'inherit', shell: true},
)
if (result.status !== 0) {
throw new Error(`pre build failure. Status: ${result.status}`)
}
}

const onPostBuild = async () => {
if (process.env.gatsby_executing_command === 'develop') {
return
}
require('./other/make-cache')
const srcLocation = path.join(__dirname, `netlify/functions`)
const outputLocation = path.join(__dirname, `public/functions`)
if (fs.existsSync(outputLocation)) {
rimraf.sync(outputLocation)
}
fs.mkdirSync(outputLocation)
await zipFunctions(srcLocation, outputLocation)
}

module.exports = {
// createPages,
onCreateWebpackConfig,
onCreateNode,
onPreBootstrap,
onPostBuild,
}

/*
Expand Down
20 changes: 0 additions & 20 deletions jest.config.js

This file was deleted.

2 changes: 1 addition & 1 deletion netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
package = "netlify-plugin-gatsby-cache"

[build]
command = "npm run netlify"
command = "npm run build"
functions = "public/functions/"
33 changes: 0 additions & 33 deletions other/load-cache.js

This file was deleted.

33 changes: 0 additions & 33 deletions other/make-cache.js

This file was deleted.

1 change: 0 additions & 1 deletion tests/file-mock.js

This file was deleted.

5 changes: 0 additions & 5 deletions tests/jest-preprocess.js

This file was deleted.

2 changes: 0 additions & 2 deletions tests/setup.js

This file was deleted.

0 comments on commit 367ad50

Please sign in to comment.