This repository has been archived by the owner on May 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
fix: annotate ISC errors and split into to separate errors #1146
Merged
Merged
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
c760fec
fix: annotate ISC errors and split into to separate errors
danez 5e373ee
chore: refactor all other places
danez df6578a
Merge branch 'main' into fix/danez/error-message
danez 1a7f7d2
chore: remove unused function and fix types
danez ca1c15a
Merge branch 'fix/danez/error-message' of github.com:netlify/zip-it-aβ¦
danez f8d68e4
Merge branch 'main' into fix/danez/error-message
kodiakhq[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
import type { Message } from '@netlify/esbuild' | ||
|
||
import type { FunctionConfig } from '../../../config.js' | ||
import type { FeatureFlag, FeatureFlags } from '../../../feature_flags.js' | ||
import type { FunctionSource } from '../../../function.js' | ||
import type { ModuleFormat } from '../utils/module_format.js' | ||
|
||
export type NodeBundlerName = 'esbuild' | 'esbuild_zisi' | 'nft' | 'zisi' | ||
|
||
// TODO: Create a generic warning type | ||
type BundlerWarning = Message | ||
|
||
type CleanupFunction = () => Promise<void> | ||
|
||
export type NativeNodeModules = Record<string, Record<string, string | undefined>> | ||
|
||
export type BundleFunction = ( | ||
args: { | ||
basePath?: string | ||
config: FunctionConfig | ||
featureFlags: Record<FeatureFlag, boolean> | ||
pluginsModulesPath?: string | ||
repositoryRoot?: string | ||
} & FunctionSource, | ||
) => Promise<{ | ||
// Aliases are used to change the path that a file should take inside the | ||
// generated archive. For example: | ||
// | ||
// "/my-transpiled-function.js" => "/my-function.js" | ||
// | ||
// When "/my-transpiled-function.js" is found in the list of files, it will | ||
// be added to the archive with the "/my-function.js" path. | ||
aliases?: Map<string, string> | ||
|
||
// Rewrites are used to change the source file associated with a given path. | ||
// For example: | ||
// | ||
// "/my-function.js" => "console.log(`Hello!`)" | ||
// | ||
// When "/my-function.js" is found in the list of files, it will be added to | ||
// the archive with "console.log(`Hello!`)" as its source, replacing whatever | ||
// the file at "/my-function.js" contains. | ||
rewrites?: Map<string, string> | ||
|
||
basePath: string | ||
bundlerWarnings?: BundlerWarning[] | ||
cleanupFunction?: CleanupFunction | ||
includedFiles: string[] | ||
inputs: string[] | ||
mainFile: string | ||
moduleFormat: ModuleFormat | ||
nativeNodeModules?: NativeNodeModules | ||
nodeModulesWithDynamicImports?: string[] | ||
srcFiles: string[] | ||
}> | ||
|
||
export type GetSrcFilesFunction = ( | ||
args: { | ||
basePath?: string | ||
config: FunctionConfig | ||
featureFlags: FeatureFlags | ||
pluginsModulesPath?: string | ||
repositoryRoot?: string | ||
} & FunctionSource, | ||
) => Promise<{ srcFiles: string[]; includedFiles: string[] }> | ||
|
||
export interface NodeBundler { | ||
bundle: BundleFunction | ||
getSrcFiles: GetSrcFilesFunction | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to extract all the types from
index.js
intotypes.js
, to avoid a cycle dependency.