Skip to content

Commit

Permalink
refactor: move function builders to functions lib (#2811)
Browse files Browse the repository at this point in the history
* refactor: move function builders to functions lib

* chore: remove old zisi builder file
  • Loading branch information
eduardoboucas authored Jun 30, 2021
1 parent 25a0b59 commit 4d8c7e7
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 25 deletions.
17 changes: 0 additions & 17 deletions src/function-builder-detectors/README.md

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const execa = require('execa')
const debounce = require('lodash/debounce')
const minimist = require('minimist')

const { fileExistsAsync, readFileAsync } = require('../lib/fs')
const { fileExistsAsync, readFileAsync } = require('../../../../fs')

const DEBOUNCE_WAIT = 300

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ const makeDir = require('make-dir')
const pFilter = require('p-filter')
const sourceMapSupport = require('source-map-support')

const { normalizeFunctionsConfig } = require('../lib/functions/config')
const { memoizedBuild } = require('../lib/functions/memoized-build')
const { getPathInProject } = require('../lib/settings')
const { getFunctions } = require('../utils/get-functions')
const { NETLIFYDEVERR } = require('../utils/logo')
const { getFunctions } = require('../../../../../utils/get-functions')
const { NETLIFYDEVERR } = require('../../../../../utils/logo')
const { getPathInProject } = require('../../../../settings')
const { normalizeFunctionsConfig } = require('../../../config')
const { memoizedBuild } = require('../../../memoized-build')

const ZIP_CONCURRENCY = 5

Expand Down
5 changes: 3 additions & 2 deletions src/utils/detect-functions-builder.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ const fs = require('fs')
const path = require('path')

const detectFunctionsBuilder = async function (parameters) {
const buildersPath = path.join(__dirname, '..', 'lib', 'functions', 'runtimes', 'js', 'builders')
const detectors = fs
.readdirSync(path.join(__dirname, '..', 'function-builder-detectors'))
.readdirSync(buildersPath)
// only accept .js detector files
.filter((filename) => filename.endsWith('.js'))
// Sorting by filename
.sort()
// eslint-disable-next-line node/global-require, import/no-dynamic-require
.map((det) => require(path.join(__dirname, '..', `function-builder-detectors/${det}`)))
.map((det) => require(path.join(buildersPath, det)))

for (const detector of detectors) {
// eslint-disable-next-line no-await-in-loop
Expand Down

1 comment on commit 4d8c7e7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📊 Benchmark results

Package size: 331 MB

Please sign in to comment.