Skip to content

Commit 5f8b128

Browse files
authored
fix: remove references to fully rolled out zisi_fix_symlinks feature flag (#6054)
1 parent 4589f16 commit 5f8b128

File tree

7 files changed

+9
-40
lines changed

7 files changed

+9
-40
lines changed

packages/zip-it-and-ship-it/src/feature_flags.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,6 @@ export const defaultFlags = {
2727
// If multiple glob stars are in includedFiles, fail the build instead of warning.
2828
zisi_esbuild_fail_double_glob: false,
2929

30-
// fixes symlinks in included files
31-
zisi_fix_symlinks: false,
32-
3330
// Adds the `___netlify-telemetry.mjs` file to the function bundle.
3431
zisi_add_instrumentation_loader: true,
3532

packages/zip-it-and-ship-it/src/runtimes/node/bundlers/esbuild/src_files.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,10 @@ import { getNewCache, TraversalCache } from '../../utils/traversal_cache.js'
44
import type { GetSrcFilesFunction } from '../types.js'
55
import { getDependencyPathsForDependency } from '../zisi/traverse.js'
66

7-
export const getSrcFiles: GetSrcFilesFunction = async ({
8-
config,
9-
mainFile,
10-
pluginsModulesPath,
11-
srcDir,
12-
featureFlags,
13-
}) => {
7+
export const getSrcFiles: GetSrcFilesFunction = async ({ config, mainFile, pluginsModulesPath, srcDir }) => {
148
const { externalNodeModules = [], includedFiles = [], includedFilesBasePath, nodeVersion } = config
159
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(
1610
includedFiles,
17-
featureFlags,
1811
includedFilesBasePath,
1912
)
2013
const dependencyPaths = await getSrcFilesForDependencies({

packages/zip-it-and-ship-it/src/runtimes/node/bundlers/nft/index.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ const bundle: BundleFunction = async ({
5353

5454
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(
5555
includedFiles,
56-
featureFlags,
5756
includedFilesBasePath || basePath,
5857
)
5958
const {
@@ -239,11 +238,10 @@ const traceFilesAndTranspile = async function ({
239238
}
240239
}
241240

242-
const getSrcFiles: GetSrcFilesFunction = async function ({ basePath, config, mainFile, featureFlags }) {
241+
const getSrcFiles: GetSrcFilesFunction = async function ({ basePath, config, mainFile }) {
243242
const { includedFiles = [], includedFilesBasePath } = config
244243
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(
245244
includedFiles,
246-
featureFlags,
247245
includedFilesBasePath,
248246
)
249247
const { fileList: dependencyPaths } = await nodeFileTrace([mainFile], {

packages/zip-it-and-ship-it/src/runtimes/node/bundlers/none/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,10 @@ const getModuleFormat = async function (mainFile: string): Promise<ModuleFormat>
3737
return MODULE_FORMAT.COMMONJS
3838
}
3939

40-
export const getSrcFiles: GetSrcFilesFunction = async function ({ config, mainFile, featureFlags }) {
40+
export const getSrcFiles: GetSrcFilesFunction = async function ({ config, mainFile }) {
4141
const { includedFiles = [], includedFilesBasePath } = config
4242
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(
4343
includedFiles,
44-
featureFlags,
4544
includedFilesBasePath,
4645
)
4746
const includedPaths = filterExcludedPaths(includedFilePaths, excludePatterns)

packages/zip-it-and-ship-it/src/runtimes/node/bundlers/zisi/src_files.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export const getSrcFiles: GetSrcFilesFunction = async function ({
3131
const { includedFiles = [], includedFilesBasePath, nodeVersion } = config
3232
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(
3333
includedFiles,
34-
featureFlags,
3534
includedFilesBasePath,
3635
)
3736
const [treeFiles, depFiles] = await Promise.all([

packages/zip-it-and-ship-it/src/runtimes/node/utils/included_files.ts

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { normalize, resolve } from 'path'
22

33
import fastGlob from 'fast-glob'
44

5-
import { type FeatureFlags } from '../../../feature_flags.js'
65
import { minimatch } from '../../../utils/matching.js'
76

87
// Returns the subset of `paths` that don't match any of the glob expressions
@@ -19,7 +18,6 @@ export const filterExcludedPaths = (paths: string[], excludePattern: string[] =
1918

2019
export const getPathsOfIncludedFiles = async (
2120
includedFiles: string[],
22-
featureFlags: FeatureFlags,
2321
basePath?: string,
2422
): Promise<{ excludePatterns: string[]; paths: string[] }> => {
2523
if (basePath === undefined) {
@@ -55,23 +53,14 @@ export const getPathsOfIncludedFiles = async (
5553
cwd: basePath,
5654
dot: true,
5755
ignore: excludePatterns,
58-
...(featureFlags.zisi_fix_symlinks
59-
? {
60-
onlyFiles: false,
61-
// get directories as well to get symlinked directories,
62-
// to filter the regular non symlinked directories out mark them with a slash at the end to filter them out.
63-
markDirectories: true,
64-
followSymbolicLinks: false,
65-
}
66-
: {
67-
followSymbolicLinks: true,
68-
throwErrorOnBrokenSymbolicLink: true,
69-
}),
56+
onlyFiles: false,
57+
// get directories as well to get symlinked directories,
58+
// to filter the regular non symlinked directories out mark them with a slash at the end to filter them out.
59+
markDirectories: true,
60+
followSymbolicLinks: false,
7061
})
7162

72-
const paths = featureFlags.zisi_fix_symlinks
73-
? pathGroups.filter((path) => !path.endsWith('/')).map(normalize)
74-
: pathGroups.map(normalize)
63+
const paths = pathGroups.filter((path) => !path.endsWith('/')).map(normalize)
7564

7665
// now filter the non symlinked directories out that got marked with a trailing slash
7766
return { excludePatterns, paths }

packages/zip-it-and-ship-it/tests/symlinked_included_files.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ test.skipIf(platform() === 'win32')('Symlinked directories from `includedFiles`
4646
includedFiles: ['**'],
4747
},
4848
},
49-
featureFlags: {
50-
zisi_fix_symlinks: true,
51-
},
5249
repositoryRoot: basePath,
5350
systemLog: console.log,
5451
debug: true,
@@ -101,9 +98,6 @@ test('preserves multiple symlinks that link to the same target', async () => {
10198
includedFiles: ['**'],
10299
},
103100
},
104-
featureFlags: {
105-
zisi_fix_symlinks: true,
106-
},
107101
repositoryRoot: basePath,
108102
systemLog: console.log,
109103
debug: true,

0 commit comments

Comments
 (0)