All notable changes to this project will be documented in this file.
0.7.0 - 2024-11-10
- updated the list of predefined variables with
ALL_PROXY
andall_proxy
(#116)
- improve heredoc parser so that invalid delimiters are now skipped over when parsing (#117)
- stop considering a heredoc delimiter without a closing quote as a heredoc (#114)
0.6.1 - 2023-09-10
- consider empty tags correctly when a
FROM
instruction also has a digest specified (#113)
0.6.0 - 2023-09-09
- allow
getImageTagRange()
andgetImageTag()
inFrom
to handle instructions where both a tag and a digest has been specified (#112)
0.5.0 - 2022-08-04
- new API to support processing heredocs of a
COPY
instruction (#109)Copy
getHeredocs()
- correct the parser so that the UTF-8 BOM will be skipped over if it is found at the beginning of the file (#106)
0.4.2 - 2022-01-22
getContentRange()
fromHeredoc
will now return correct ranges if there are empty lines in the heredoc (#103)- export
Heredoc
frommain.ts
(#104)
0.4.1 - 2021-12-11
- export
Run
so it can be used by clients (#102)
0.4.0 - 2021-12-11
- new API for handling here-documents, note that this API is considered experimental and may be subject to change in the future (#101)
Heredoc
getName()
getStartRange()
getContentRange()
getNameRange()
getDelimiterRange()
Run
getHeredocs()
- prevent infinite loop in
getAvailableWorkingDirectories()
when an image shares the same name as the build stage (#100)
0.3.4 - 2021-09-21
- prevent comments from marking the end of an instruction if it is embedded within a keyword (#99)
0.3.3 - 2021-09-19
- prevent merging of instructions if the keyword has an escape character in it and spans multiple lines (#98)
0.3.2 - 2021-09-07
- prevent merging of instructions if the keyword has an escape character in it (#97)
0.3.1 - 2021-08-28
0.3.0 - 2021-07-28
- enabled support for parsing heredocs in Dockerfiles (#92)
- fix line range calculation when the last non-whitespace character is an escape character (#92)
0.2.1 - 2021-04-11
- fix parsing of an escape character immediately following a label which caused the next label to be parsed incorrectly (#90)
0.2.0 - 2021-02-21
0.1.0 - 2020-12-24
0.0.30 - 2020-07-14
- do not consider a single escape character as being an argument for the instruction (#83)
- do not consider a single escape character as being a property for an instruction (#84)
0.0.29 - 2020-07-12
- ignore leading whitespace before a comment in escaped newlines for
getArgumentsContent()
andgetArgumentsRanges()
ofInstruction
(#82)
0.0.28 - 2020-07-11
- improve handling of trailing whitespace that is not a newline character after an escape character (#81)
0.0.27 - 2020-06-17
- allow comments to immediately follow the declaration of an ARG or ENV instruction (#80)
0.0.26 - 2020-04-22
- correct range of multiline arguments that end with a character preceded by an escape character (#78)
- correct range of arguments that are split on multiple lines with escaped whitespace lines in between (#77)
- enable parsing of flag options that do not have a value defined (#79)
0.0.25 - 2020-04-01
Flag
FlagOption
(#75)Run
(#76)RUN
instructions will now of typeRun
instead ofJSONInstruction
Run
extendsJSONInstruction
so this is not be a breaking change
- allow
From
'sgetBuildStage()
andgetBuildStageRange()
to return non-null
values even if the instruction has more than three arguments as long as parts of it is valid (#74)
0.0.24 - 2020-03-08
Instruction
'sgetArguments()
will no longer exclude arguments that follow an embedded comment that ends with the escape character (#73)
0.0.23 - 2020-03-08
Instruction
'sgetArguments()
will no longer incorrectly exclude arguments because they look like comments (#72)
0.0.22 - 2020-03-07
- instructions will no longer be cut off prematurely due to empty continuation lines embedded in the keyword itself (#70)
Instruction
'sgetArguments()
will now correctly account for multiple embedded comments instead of considering them as an argument (#71)
0.0.21 - 2020-02-27
Instruction
'sgetArgumentsRanges()
will no longer throw an error if an instruction spans multiple lines and has escaped newlines at the beginning of a line (#67)ModifiableInstruction
'stoString()
will now include the instruction's flags (#68)ModifiableInstruction
'sgetVariables()
will now include variables that are used in the instruction's flags (#69)
0.0.20 - 2020-02-11
-
Dockerfile
getDirectives()
(#62)- originally introduced in 0.0.18 to support compatibility in the future, the function is now fully implemented and will return an ordered list of all the parser directives defined at the top of the Dockerfile
-
Directive
syntax
(#63)- this enum can be used for identifying the
syntax
parser directive used by BuildKit
- this enum can be used for identifying the
ParserDirective
getDirective()
(#63)- this function originally stated that it would return a
Directive
undefined
would be returned if the name of the parser directive was not recognized- the function now returns
Directive | null
- the function will return
null
if the parser directive is not recognized instead ofundefined
- this function originally stated that it would return a
Instruction
'sgetArgumentsRanges()
will no longer throw an error if the instruction has its last argument on its own line with no leading whitespace and the length of that argument is one (#66)
0.0.19 - 2020-01-27
From
getPlatformFlag()
(#65)
From
- this class now subclasses
ModifiableInstruction
instead ofInstruction
(#65)- this was changed to support the
--platform
flag introduced in Docker CE 18.04 - as
ModifiableInstruction
extendsInstruction
, this should not impact anyone at an API level from a compilation standpoint - note that this will break users that previously used
getArguments()
to parse and retrieve the--platform
flag manually, please replace such usages with the newgetPlatformFlag()
API
- this was changed to support the
- this class now subclasses
0.0.18 - 2019-12-07
Dockerfile
getDirectives()
(#64)
getDirective()
ofDockerfile
has been deprecated and will be replaced bygetDirectives()
in the future (#64)- note that this is purely a cosmetic API change to facilitate migration at the moment, proper support for returning an array will follow in the future
- add support for TypeScript 3.7 by fixing TS2440 compiler error (#61)
0.0.17 - 2019-10-13
- correct parsing of image names that were incorrectly identified as a Docker registry (#59)
0.0.16 - 2019-05-22
- only allow alphanumeric and underscore characters in variable names (#58)
0.0.15 - 2019-05-21
- variables in
FROM
should returntrue
forisDefined()
if it is defined in theARG
instructions above it (#56) - variables in
FROM
should returntrue
forisBuildVariable()
if it is defined in theARG
instructions above it (#57)
0.0.14 - 2019-04-28
ImageTemplate
getRange()
(#53)
- the enum value for
Keyword.ADD
was incorrectly assigned to"ARG"
, it is now assigned to"ADD"
(#51)- this is a breaking change but presumably no consumers were relying on this incorrect behaviour
Dockerfile
'sgetContainingImage()
has been changed for comments immediately before a build stage- previously, they would return the build stage that came after the comment, now they will simply return the entire Dockerfile
- this is because the comment is actually ambiguous as it may be a commented out instruction for the build stage that came before the comment
- correct incorrectly assigned string enum value for
Keyword.ADD
(#51) - ensure quotation marks and apostrophes are included for expanded arguments in
Instruction
'sgetExpandedArguments()
if they surround a variable (#52) - fixed
getComments()
for build stages so that they will not simply return empty arrays (#54)- the returned comments will only be from comments contained within the
FROM
instruction and the last instruction of that build stage
- the returned comments will only be from comments contained within the
0.0.13 - 2018-12-20
- prevent TypeError from being thrown by
Dockerfile
'sresolveVariable(string, number)
when an invalid line number is provided (#48) - correct compiler error due to incomplete interface signature (#46)
0.0.12 - 2018-08-10
- handle quoted properties on separate lines properly for
ENV
s andLABEL
s (#44)
0.0.11 - 2018-06-16
- ignore initial
ENV
s when resolving variables inFROM
s (#44)
0.0.10 - 2018-06-16
From
- upgraded the dependency of Mocha from 3.x to 5.x
- versions prior to 4.x of Mocha depended on Growl 1.9.2 which contained a security vulnerability
- as Mocha is a
devDependencies
module, there is no reason to believe that thedockerfile-ast
module itself was affected by this vulnerability
- do not resolve reinitialized
ARG
variables withENV
instructions at the top of the Dockerfile (#42) - improve parsing of
FROM
instructions that refer to variables (#39)
0.0.9 - 2018-05-28
- handle comments in the last line of a file properly for
ARG
,ENV
, andLABEL
(#40) - parse
ARG
instructions properly when its value contains an unclosed quote (#41)
0.0.8 - 2018-05-27
- prevent
getVariables()
from throwing an error if aLABEL
has no value defined (#38)
0.0.7 - 2018-05-25
PropertyInstruction
getArguments()
(#34)- to make this function more predictable,
PropertyInstruction
no longer overrides this function with its own implementation, existing callers should callgetPropertyArguments()
instead if the old behaviour is desired
- to make this function more predictable,
// this function has been changed to possibly not return the same thing
// depending on the structure of the instruction's arguments
let args = propertyInstruction.getArguments();
// to get the same behaviour in 0.0.6, use getPropertyArguments() instead
let args = propertyInstruction.getPropertyArguments();
- resolve references to uninitialized
ARG
variables againstARG
variables before the firstFROM
if present (#26) - change
FROM
to parse its image argument correctly if it is in a private registry (#28) - fix parsing issue with quoted keys and values in
ARG
,ENV
, andLABEL
(#30) - ignore equals signs that are found inside quotes (#29)
- prevent arguments from being split up if they span multiple lines via escaped newlines (#34)
- prevent variables from being split up if they span multiple lines via escaped newlines (#35)
0.0.6 - 2018-04-19
Property
getRawValue()
has been renamed togetUnescapedValue()
(#25)- the underlying implementation of the function has not changed so it should be easy for clients to migrate to the new API
- fix parsing of spaces embedded within a variable replacement in
ARG
,ENV
, andLABEL
instructions (#24)
0.0.5 - 2018-04-15
- fix resolution of
ARG
variables that are used in aFROM
(#22) - prevent error from being thrown if an invalid line number is specified by
Dockerfile
'sgetAvailableVariables(number)
function (#23)
0.0.4 - 2018-04-03
JSONInstruction
getJSONStrings()
now returnsJSONArgument[]
instead ofArgument[]
- since
JSONArgument
extendsArgument
, any existing code should continue to work with no code changes required
- since
0.0.3 - 2018-02-10
- calling
ImageTemplate
'sgetAvailableVariables(number)
with a Dockerfile should only return the variables that are declared in the build stage of the given line (#15) - correct
From
'sgetImageName()
to return the right name for the image if it is pointing at a digest (#17) - calling
ImageTemplate
'sgetAvailableVariables(number)
on a line with aFROM
should return variables defined by the Dockerfile's initialARG
instructions (if any) (#18)
0.0.2 - 2018-01-20
Argument
toString()
(#4)
Variable
- restrict variable resolution to the containing build stage (#14)
Argument
'sgetRawValue()
function has been removed (#10)
// this convenience function has been removed
let rawValue = argument.getRawValue();
// to retrieve the identical value, use the following code instead
import { TextDocument } from 'vscode-languageserver-types';
let document = TextDocument.create(uri, languageId, version, buffer);
let range = argument.getRange();
let rawValue = buffer.substring(document.offsetAt(range.start), document.offsetAt(range.end));
- Dockerfile parser
- handles escape characters
- preserves comments
- provides variable lookup and resolution