@netlify/build 18.11.1 → 18.13.1-rc

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": "18.11.1",
3
+ "version": "18.13.1-rc",
4
4
  "description": "Netlify build module",
5
5
  "main": "src/core/main.js",
6
6
  "bin": {
@@ -59,7 +59,7 @@
59
59
  "@netlify/plugin-edge-handlers": "^1.11.22",
60
60
  "@netlify/plugins-list": "^3.6.0",
61
61
  "@netlify/run-utils": "^2.0.0",
62
- "@netlify/zip-it-and-ship-it": "^4.22.0",
62
+ "@netlify/zip-it-and-ship-it": "^4.23.0",
63
63
  "@sindresorhus/slugify": "^1.1.0",
64
64
  "@ungap/from-entries": "^0.2.1",
65
65
  "ansi-escapes": "^4.3.2",
@@ -1,7 +1,5 @@
1
1
  'use strict'
2
2
 
3
- const { env } = require('process')
4
-
5
3
  // From CLI `--featureFlags=a,b,c` to programmatic `{ a: true, b: true, c: true }`
6
4
  const normalizeCliFeatureFlags = function (cliFeatureFlags) {
7
5
  return Object.assign({}, ...cliFeatureFlags.split(',').filter(isNotEmpty).map(getFeatureFlag))
@@ -17,8 +15,8 @@ const getFeatureFlag = function (name) {
17
15
 
18
16
  // Default values for feature flags
19
17
  const DEFAULT_FEATURE_FLAGS = {
20
- zisiEsbuildDynamicImports: env.NETLIFY_EXPERIMENTAL_PROCESS_DYNAMIC_IMPORTS === 'true',
21
18
  buildbot_es_modules_esbuild: false,
19
+ buildbot_zisi_esbuild_parser: false,
22
20
  }
23
21
 
24
22
  module.exports = { normalizeCliFeatureFlags, DEFAULT_FEATURE_FLAGS }
@@ -7,13 +7,13 @@ const { addLazyProp } = require('./lazy')
7
7
  const { show } = require('./status')
8
8
 
9
9
  // Retrieve the `utils` argument.
10
- const getUtils = function ({ event, constants: { FUNCTIONS_SRC, CACHE_DIR }, runState }) {
10
+ const getUtils = function ({ event, constants: { FUNCTIONS_SRC, INTERNAL_FUNCTIONS_SRC, CACHE_DIR }, runState }) {
11
11
  const build = getBuildUtils(event)
12
12
  const utils = { build }
13
13
  addLazyProp(utils, 'git', getGitUtils)
14
14
  addLazyProp(utils, 'cache', getCacheUtils.bind(null, CACHE_DIR))
15
15
  addLazyProp(utils, 'run', getRunUtils)
16
- addLazyProp(utils, 'functions', getFunctionsUtils.bind(null, FUNCTIONS_SRC))
16
+ addLazyProp(utils, 'functions', getFunctionsUtils.bind(null, FUNCTIONS_SRC, INTERNAL_FUNCTIONS_SRC))
17
17
  addLazyProp(utils, 'status', getStatusUtils.bind(null, runState))
18
18
  return utils
19
19
  }
@@ -46,12 +46,13 @@ const getRunUtils = function () {
46
46
  return require('@netlify/run-utils')
47
47
  }
48
48
 
49
- const getFunctionsUtils = function (FUNCTIONS_SRC) {
49
+ const getFunctionsUtils = function (FUNCTIONS_SRC, INTERNAL_FUNCTIONS_SRC) {
50
+ const functionsDirectories = [INTERNAL_FUNCTIONS_SRC, FUNCTIONS_SRC].filter(Boolean)
50
51
  // eslint-disable-next-line node/global-require
51
52
  const functionsUtils = require('@netlify/functions-utils')
52
- const add = (src) => functionsUtils.add(src, FUNCTIONS_SRC, { fail: failBuild })
53
- const list = functionsUtils.list.bind(null, FUNCTIONS_SRC, { fail: failBuild })
54
- const listAll = functionsUtils.listAll.bind(null, FUNCTIONS_SRC, { fail: failBuild })
53
+ const add = (src) => functionsUtils.add(src, INTERNAL_FUNCTIONS_SRC, { fail: failBuild })
54
+ const list = functionsUtils.list.bind(null, functionsDirectories, { fail: failBuild })
55
+ const listAll = functionsUtils.listAll.bind(null, functionsDirectories, { fail: failBuild })
55
56
  return { add, list, listAll }
56
57
  }
57
58
 
@@ -25,7 +25,7 @@ const isUsingEsbuild = (functionsConfig = {}) =>
25
25
  // The function configuration keys returned by @netlify/config are not an exact
26
26
  // match to the properties that @netlify/zip-it-and-ship-it expects. We do that
27
27
  // translation here.
28
- const normalizeFunctionConfig = ({ buildDir, featureFlags, functionConfig = {}, isRunningLocally }) => ({
28
+ const normalizeFunctionConfig = ({ buildDir, functionConfig = {}, isRunningLocally }) => ({
29
29
  externalNodeModules: functionConfig.external_node_modules,
30
30
  includedFiles: functionConfig.included_files,
31
31
  includedFilesBasePath: buildDir,
@@ -38,11 +38,6 @@ const normalizeFunctionConfig = ({ buildDir, featureFlags, functionConfig = {},
38
38
  // `esbuild` into `esbuild_zisi`, which zip-it-and-ship-it understands.
39
39
  nodeBundler: functionConfig.node_bundler === 'esbuild' ? 'esbuild_zisi' : functionConfig.node_bundler,
40
40
 
41
- // With the `zisiEsbuildDynamicImports` feature flag, zip-it-and-ship-it will
42
- // resolve dynamic import expressions by injecting shim files to make the
43
- // expressions resolve to the right paths at runtime.
44
- processDynamicNodeImports: Boolean(featureFlags.zisiEsbuildDynamicImports),
45
-
46
41
  // If the build is running in buildbot, we set the Rust target directory to a
47
42
  // path that will get cached in between builds, allowing us to speed up the
48
43
  // build process.
@@ -58,6 +53,7 @@ const getZisiParameters = ({ buildDir, featureFlags, functionsConfig, functionsD
58
53
  ])
59
54
  const zisiFeatureFlags = {
60
55
  defaultEsModulesToEsbuild: featureFlags.buildbot_es_modules_esbuild,
56
+ parseWithEsbuild: featureFlags.buildbot_zisi_esbuild_parser,
61
57
  }
62
58
 
63
59
  return { basePath: buildDir, config, manifest, featureFlags: zisiFeatureFlags }