netlify-cli 12.9.2 → 12.10.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.
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
- "version": "12.9.2",
3
+ "version": "12.10.0",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "netlify-cli",
9
- "version": "12.9.2",
9
+ "version": "12.10.0",
10
10
  "hasInstallScript": true,
11
11
  "license": "MIT",
12
12
  "dependencies": {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "netlify-cli",
3
3
  "description": "Netlify command line tool",
4
- "version": "12.9.2",
4
+ "version": "12.10.0",
5
5
  "author": "Netlify Inc.",
6
6
  "type": "module",
7
7
  "engines": {
@@ -56,7 +56,7 @@ export const deploySite = async (
56
56
  })
57
57
 
58
58
  const edgeFunctionsDistPath = await getDistPathIfExists({ rootDir })
59
- const [{ files, filesShaMap }, { fnShaMap, functionSchedules, functions, functionsWithNativeModules }] =
59
+ const [{ files, filesShaMap }, { fnConfig, fnShaMap, functionSchedules, functions, functionsWithNativeModules }] =
60
60
  await Promise.all([
61
61
  hashFiles({
62
62
  assetType,
@@ -125,6 +125,7 @@ For more information, visit https://ntl.fyi/cli-native-modules.`)
125
125
  files,
126
126
  functions,
127
127
  function_schedules: functionSchedules,
128
+ functions_config: fnConfig,
128
129
  async: Object.keys(files).length > syncFileLimit,
129
130
  branch,
130
131
  draft,
@@ -1,10 +1,12 @@
1
1
  import { readFile } from 'fs/promises'
2
- import path from 'path'
2
+ import path, { join } from 'path'
3
3
  import { promisify } from 'util'
4
4
 
5
5
  import fromArray from 'from2-array'
6
6
  import pumpModule from 'pump'
7
7
 
8
+ import { INTERNAL_FUNCTIONS_FOLDER } from '../functions/functions.mjs'
9
+
8
10
  import { hasherCtor, manifestCollectorCtor } from './hasher-segments.mjs'
9
11
 
10
12
  const pump = promisify(pumpModule)
@@ -65,7 +67,12 @@ const getFunctionZips = async ({
65
67
 
66
68
  const { zipFunctions } = await import('@netlify/zip-it-and-ship-it')
67
69
 
68
- return await zipFunctions(directories, tmpDir, { basePath: rootDir, config: functionsConfig })
70
+ return await zipFunctions(directories, tmpDir, {
71
+ featureFlags: { project_deploy_configuration_api_use_per_function_configuration_files: true },
72
+ basePath: rootDir,
73
+ configFileDirectories: [join('.netlify', INTERNAL_FUNCTIONS_FOLDER)],
74
+ config: functionsConfig,
75
+ })
69
76
  }
70
77
 
71
78
  const hashFns = async (
@@ -100,7 +107,7 @@ const hashFns = async (
100
107
  statusCb,
101
108
  tmpDir,
102
109
  })
103
- const fileObjs = functionZips.map(({ path: functionPath, runtime }) => ({
110
+ const fileObjs = functionZips.map(({ displayName, path: functionPath, runtime }) => ({
104
111
  filepath: functionPath,
105
112
  root: tmpDir,
106
113
  relname: path.relative(tmpDir, functionPath),
@@ -110,7 +117,11 @@ const hashFns = async (
110
117
  assetType: 'function',
111
118
  normalizedPath: path.basename(functionPath, path.extname(functionPath)),
112
119
  runtime,
120
+ displayName,
113
121
  }))
122
+ const fnConfig = functionZips
123
+ .filter((func) => Boolean(func.displayName))
124
+ .reduce((funcs, curr) => ({ ...funcs, [curr.name]: { display_name: curr.displayName } }), {})
114
125
  const functionSchedules = functionZips
115
126
  .map(({ name, schedule }) => schedule && { name, cron: schedule })
116
127
  .filter(Boolean)
@@ -130,8 +141,7 @@ const hashFns = async (
130
141
  const manifestCollector = manifestCollectorCtor(functions, fnShaMap, { statusCb, assetType })
131
142
 
132
143
  await pump(functionStream, hasher, manifestCollector)
133
-
134
- return { functionSchedules, functions, functionsWithNativeModules, fnShaMap }
144
+ return { functionSchedules, functions, functionsWithNativeModules, fnShaMap, fnConfig }
135
145
  }
136
146
 
137
147
  export default hashFns