Skip to content
This repository was archived by the owner on May 22, 2024. It is now read-only.

Commit 13735a9

Browse files
authoredFeb 27, 2023
feat: remove ff project_deploy_configuration_api_use_per_function_configuration_files (#1355)
1 parent 09b01b4 commit 13735a9

7 files changed

+2
-23
lines changed
 

‎src/config.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import isPathInside from 'is-path-inside'
55
// @ts-expect-error Typescript cannot find definition
66
import mergeOptions from 'merge-options'
77

8-
import type { FeatureFlags } from './feature_flags.js'
98
import { FunctionSource } from './function.js'
109
import type { NodeBundlerType } from './runtimes/node/bundlers/types.js'
1110
import type { NodeVersionString } from './runtimes/node/index.js'
@@ -47,20 +46,16 @@ const getConfigForFunction = async ({
4746
config,
4847
configFileDirectories,
4948
func,
50-
featureFlags,
5149
}: {
5250
config?: Config
5351
configFileDirectories?: string[]
5452
func: FunctionWithoutConfig
55-
featureFlags: FeatureFlags
5653
}): Promise<FunctionConfig> => {
5754
const fromConfig = getFromMainConfig({ config, func })
5855

5956
// We try to read from a function config file if the function directory is
6057
// inside one of `configFileDirectories`.
61-
const shouldReadConfigFile =
62-
featureFlags.project_deploy_configuration_api_use_per_function_configuration_files &&
63-
configFileDirectories?.some((directory) => isPathInside(func.mainFile, directory))
58+
const shouldReadConfigFile = configFileDirectories?.some((directory) => isPathInside(func.mainFile, directory))
6459

6560
if (!shouldReadConfigFile) {
6661
return fromConfig

‎src/feature_flags.ts

-3
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ export const defaultFlags: Record<string, boolean> = {
1818
// `.mjs` extension.
1919
zisi_pure_esm_mjs: false,
2020

21-
// Load configuration from per-function JSON files.
22-
project_deploy_configuration_api_use_per_function_configuration_files: false,
23-
2421
// Output CJS file extension
2522
zisi_output_cjs_extension: false,
2623

‎src/runtimes/index.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ export const getFunctionsFromPaths = async (
120120
}
121121
}, Promise.resolve({ functions: [], remainingPaths: paths } as { functions: FunctionTupleWithoutConfig[]; remainingPaths: string[] }))
122122
const functionConfigs = await Promise.all(
123-
functions.map(([, func]) => getConfigForFunction({ config, configFileDirectories, func, featureFlags })),
123+
functions.map(([, func]) => getConfigForFunction({ config, configFileDirectories, func })),
124124
)
125125
const functionsWithConfig: FunctionTuple[] = functions.map(([name, func], index) => [
126126
name,
@@ -150,7 +150,6 @@ export const getFunctionFromPath = async (
150150
config,
151151
configFileDirectories,
152152
func: { ...func, runtime },
153-
featureFlags,
154153
})
155154

156155
return {

‎tests/list_function.test.ts

-3
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ describe('listFunction', () => {
2626
const mainFile = join(dir, 'simple.js')
2727
const func = await listFunction(mainFile, {
2828
configFileDirectories: [dir],
29-
featureFlags: {
30-
project_deploy_configuration_api_use_per_function_configuration_files: true,
31-
},
3229
})
3330

3431
expect(func).toEqual({

‎tests/list_functions.test.ts

-3
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,6 @@ describe('listFunctions', () => {
9191
const dir = join(FIXTURES_DIR, 'json-config/.netlify/functions-internal/')
9292
const [func] = await listFunctions([dir], {
9393
configFileDirectories: [dir],
94-
featureFlags: {
95-
project_deploy_configuration_api_use_per_function_configuration_files: true,
96-
},
9794
})
9895

9996
expect(func.displayName).toBe('A Display Name')

‎tests/list_functions_files.test.ts

-3
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,6 @@ describe('listFunctionsFiles', () => {
256256
const dir = join(FIXTURES_DIR, 'json-config/.netlify/functions-internal/')
257257
const [func] = await listFunctionsFiles([dir], {
258258
configFileDirectories: [dir],
259-
featureFlags: {
260-
project_deploy_configuration_api_use_per_function_configuration_files: true,
261-
},
262259
})
263260

264261
expect(func.displayName).toBe('A Display Name')

‎tests/main.test.ts

-3
Original file line numberDiff line numberDiff line change
@@ -2301,7 +2301,6 @@ describe('zip-it-and-ship-it', () => {
23012301
const opts = merge(options, {
23022302
basePath: join(FIXTURES_DIR, fixtureName),
23032303
configFileDirectories: [join(FIXTURES_DIR, pathInternal)],
2304-
featureFlags: { project_deploy_configuration_api_use_per_function_configuration_files: true },
23052304
})
23062305
const { files, tmpDir } = await zipFixture([pathInternal, pathNotInternal, pathUser], {
23072306
length: 4,
@@ -2359,7 +2358,6 @@ describe('zip-it-and-ship-it', () => {
23592358
basePath: join(FIXTURES_DIR, fixtureName),
23602359
manifest: manifestPath,
23612360
configFileDirectories: [join(FIXTURES_DIR, pathInternal)],
2362-
featureFlags: { project_deploy_configuration_api_use_per_function_configuration_files: true },
23632361
})
23642362
await zipFixture([pathInternal, pathNotInternal, pathUser], {
23652363
length: 4,
@@ -2383,7 +2381,6 @@ describe('zip-it-and-ship-it', () => {
23832381
const opts = merge(options, {
23842382
basePath: join(FIXTURES_DIR, fixtureName),
23852383
configFileDirectories: [join(FIXTURES_DIR, pathInternal)],
2386-
featureFlags: { project_deploy_configuration_api_use_per_function_configuration_files: true },
23872384
config: {
23882385
'internal-function': {
23892386
schedule: '@hourly',

1 commit comments

Comments
 (1)

github-actions[bot] commented on Feb 27, 2023

@github-actions[bot]
Contributor

⏱ Benchmark results

  • largeDepsEsbuild: 2s
  • largeDepsNft: 7.6s
  • largeDepsZisi: 15s
This repository has been archived.