Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions packages/zip-it-and-ship-it/src/feature_flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ export const defaultFlags = {
// If multiple glob stars are in includedFiles, fail the build instead of warning.
zisi_esbuild_fail_double_glob: false,

// fixes symlinks in included files
zisi_fix_symlinks: false,

// Adds the `___netlify-telemetry.mjs` file to the function bundle.
zisi_add_instrumentation_loader: true,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,10 @@ import { getNewCache, TraversalCache } from '../../utils/traversal_cache.js'
import type { GetSrcFilesFunction } from '../types.js'
import { getDependencyPathsForDependency } from '../zisi/traverse.js'

export const getSrcFiles: GetSrcFilesFunction = async ({
config,
mainFile,
pluginsModulesPath,
srcDir,
featureFlags,
}) => {
export const getSrcFiles: GetSrcFilesFunction = async ({ config, mainFile, pluginsModulesPath, srcDir }) => {
const { externalNodeModules = [], includedFiles = [], includedFilesBasePath, nodeVersion } = config
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(
includedFiles,
featureFlags,
includedFilesBasePath,
)
const dependencyPaths = await getSrcFilesForDependencies({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ const bundle: BundleFunction = async ({

const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(
includedFiles,
featureFlags,
includedFilesBasePath || basePath,
)
const {
Expand Down Expand Up @@ -239,11 +238,10 @@ const traceFilesAndTranspile = async function ({
}
}

const getSrcFiles: GetSrcFilesFunction = async function ({ basePath, config, mainFile, featureFlags }) {
const getSrcFiles: GetSrcFilesFunction = async function ({ basePath, config, mainFile }) {
const { includedFiles = [], includedFilesBasePath } = config
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(
includedFiles,
featureFlags,
includedFilesBasePath,
)
const { fileList: dependencyPaths } = await nodeFileTrace([mainFile], {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@ const getModuleFormat = async function (mainFile: string): Promise<ModuleFormat>
return MODULE_FORMAT.COMMONJS
}

export const getSrcFiles: GetSrcFilesFunction = async function ({ config, mainFile, featureFlags }) {
export const getSrcFiles: GetSrcFilesFunction = async function ({ config, mainFile }) {
const { includedFiles = [], includedFilesBasePath } = config
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(
includedFiles,
featureFlags,
includedFilesBasePath,
)
const includedPaths = filterExcludedPaths(includedFilePaths, excludePatterns)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ export const getSrcFiles: GetSrcFilesFunction = async function ({
const { includedFiles = [], includedFilesBasePath, nodeVersion } = config
const { excludePatterns, paths: includedFilePaths } = await getPathsOfIncludedFiles(
includedFiles,
featureFlags,
includedFilesBasePath,
)
const [treeFiles, depFiles] = await Promise.all([
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { normalize, resolve } from 'path'

import fastGlob from 'fast-glob'

import { type FeatureFlags } from '../../../feature_flags.js'
import { minimatch } from '../../../utils/matching.js'

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

export const getPathsOfIncludedFiles = async (
includedFiles: string[],
featureFlags: FeatureFlags,
basePath?: string,
): Promise<{ excludePatterns: string[]; paths: string[] }> => {
if (basePath === undefined) {
Expand Down Expand Up @@ -55,23 +53,14 @@ export const getPathsOfIncludedFiles = async (
cwd: basePath,
dot: true,
ignore: excludePatterns,
...(featureFlags.zisi_fix_symlinks
? {
onlyFiles: false,
// get directories as well to get symlinked directories,
// to filter the regular non symlinked directories out mark them with a slash at the end to filter them out.
markDirectories: true,
followSymbolicLinks: false,
}
: {
followSymbolicLinks: true,
throwErrorOnBrokenSymbolicLink: true,
}),
onlyFiles: false,
// get directories as well to get symlinked directories,
// to filter the regular non symlinked directories out mark them with a slash at the end to filter them out.
markDirectories: true,
followSymbolicLinks: false,
})

const paths = featureFlags.zisi_fix_symlinks
? pathGroups.filter((path) => !path.endsWith('/')).map(normalize)
: pathGroups.map(normalize)
const paths = pathGroups.filter((path) => !path.endsWith('/')).map(normalize)

// now filter the non symlinked directories out that got marked with a trailing slash
return { excludePatterns, paths }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ test.skipIf(platform() === 'win32')('Symlinked directories from `includedFiles`
includedFiles: ['**'],
},
},
featureFlags: {
zisi_fix_symlinks: true,
},
repositoryRoot: basePath,
systemLog: console.log,
debug: true,
Expand Down Expand Up @@ -101,9 +98,6 @@ test('preserves multiple symlinks that link to the same target', async () => {
includedFiles: ['**'],
},
},
featureFlags: {
zisi_fix_symlinks: true,
},
repositoryRoot: basePath,
systemLog: console.log,
debug: true,
Expand Down
Loading