@netlify/build 23.0.1 → 24.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "23.0.1",
3
+ "version": "24.0.0",
4
4
  "description": "Netlify build module",
5
5
  "main": "src/core/main.js",
6
6
  "types": "types/index.d.ts",
@@ -2,12 +2,13 @@
2
2
 
3
3
  const { relative, normalize } = require('path')
4
4
 
5
- const { getCacheDir } = require('@netlify/cache-utils')
6
5
  const mapObj = require('map-obj')
7
6
  const pathExists = require('path-exists')
8
7
 
9
8
  const { version } = require('../../package.json')
10
9
 
10
+ const cacheUtilsPromise = import('@netlify/cache-utils')
11
+
11
12
  // Retrieve constants passed to plugins
12
13
  const getConstants = async function ({
13
14
  configPath,
@@ -21,6 +22,7 @@ const getConstants = async function ({
21
22
  mode,
22
23
  }) {
23
24
  const isLocal = mode !== 'buildbot'
25
+ const { getCacheDir } = await cacheUtilsPromise
24
26
  const normalizedCacheDir = getCacheDir({ cacheDir, cwd: buildDir })
25
27
 
26
28
  const constants = {
@@ -1,20 +1,20 @@
1
1
  'use strict'
2
2
 
3
- const { bindOpts: cacheBindOpts } = require('@netlify/cache-utils')
4
-
5
3
  const { failBuild, failPlugin, cancelBuild, failPluginWithWarning } = require('../error')
6
4
  const { isSoftFailEvent } = require('../events')
7
5
 
8
6
  const { addLazyProp } = require('./lazy')
9
7
  const { show } = require('./status')
10
8
 
11
- const gitUtilsPromise = import('@netlify/git-utils')
9
+ const cacheUtilsPromise = import('@netlify/cache-utils')
12
10
  const functionsUtilsPromise = import('@netlify/functions-utils')
11
+ const gitUtilsPromise = import('@netlify/git-utils')
13
12
  const runUtilsPromise = import('@netlify/run-utils')
14
13
 
15
14
  // Retrieve the `utils` argument.
16
15
  const getUtils = async function ({ event, constants: { FUNCTIONS_SRC, INTERNAL_FUNCTIONS_SRC, CACHE_DIR }, runState }) {
17
- const [functionsUtils, { getGitUtils }, { run, runCommand }] = await Promise.all([
16
+ const [cacheUtils, functionsUtils, { getGitUtils }, { run, runCommand }] = await Promise.all([
17
+ cacheUtilsPromise,
18
18
  functionsUtilsPromise,
19
19
  gitUtilsPromise,
20
20
  runUtilsPromise,
@@ -23,7 +23,7 @@ const getUtils = async function ({ event, constants: { FUNCTIONS_SRC, INTERNAL_F
23
23
  run.command = runCommand
24
24
 
25
25
  const build = getBuildUtils(event)
26
- const cache = getCacheUtils(CACHE_DIR)
26
+ const cache = getCacheUtils(cacheUtils, CACHE_DIR)
27
27
  const functions = getFunctionsUtils(functionsUtils, FUNCTIONS_SRC, INTERNAL_FUNCTIONS_SRC)
28
28
  const status = getStatusUtils(runState)
29
29
  const utils = { build, cache, run, functions, status }
@@ -43,8 +43,8 @@ const getBuildUtils = function (event) {
43
43
  return { failBuild, failPlugin, cancelBuild }
44
44
  }
45
45
 
46
- const getCacheUtils = function (CACHE_DIR) {
47
- return cacheBindOpts({ cacheDir: CACHE_DIR })
46
+ const getCacheUtils = function (cacheUtils, CACHE_DIR) {
47
+ return cacheUtils.bindOpts({ cacheDir: CACHE_DIR })
48
48
  }
49
49
 
50
50
  const getFunctionsUtils = function (functionsUtils, FUNCTIONS_SRC, INTERNAL_FUNCTIONS_SRC) {