diff --git a/README.md b/README.md index 47880d3..9d794e5 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,7 @@ If you want to use tokens in XML based configuration files to be replaced during - Fix recursion cycle detection ([#308](https://github.com/qetza/vsts-replacetokens-task/issues/308)) (contributed by Chad Smith). - Add support for YAML multiple document files in variable files and inline variables ([#287](https://github.com/qetza/vsts-replacetokens-task/issues/287)). - Add support for JSON with comments variable files ([#299](https://github.com/qetza/vsts-replacetokens-task/issues/299)). + - Add support for Node16 execution handler. - Task **4.3.0** - Fix recursion cycle detection ([#308](https://github.com/qetza/vsts-replacetokens-task/issues/308)) (contributed by Chad Smith). - Add support for YAML multiple document files in variable files and inline variables ([#287](https://github.com/qetza/vsts-replacetokens-task/issues/287)). diff --git a/tasks/ReplaceTokensV5/README.md b/tasks/ReplaceTokensV5/README.md index e9868cf..cde0158 100644 --- a/tasks/ReplaceTokensV5/README.md +++ b/tasks/ReplaceTokensV5/README.md @@ -97,6 +97,7 @@ If you want to use tokens in XML based configuration files to be replaced during - Fix recursion cycle detection ([#308](https://github.com/qetza/vsts-replacetokens-task/issues/308)) (contributed by Chad Smith). - Add support for YAML multiple document files in variable files and inline variables ([#287](https://github.com/qetza/vsts-replacetokens-task/issues/287)). - Add support for JSON with comments variable files ([#299](https://github.com/qetza/vsts-replacetokens-task/issues/299)). +- Add support for Node16 execution handler. **New in 5.1.0** - Add support for inline variables ([#252](https://github.com/qetza/vsts-replacetokens-task/issues/252)). diff --git a/tasks/ReplaceTokensV5/package-lock.json b/tasks/ReplaceTokensV5/package-lock.json index efe47ec..96bb86a 100644 --- a/tasks/ReplaceTokensV5/package-lock.json +++ b/tasks/ReplaceTokensV5/package-lock.json @@ -7,7 +7,8 @@ "": { "name": "replacetokens-v5", "dependencies": { - "azure-pipelines-task-lib": "^3.1.10", + "@types/node": "^16.11.39", + "azure-pipelines-task-lib": "^4.1.0", "iconv-lite": "^0.4.15", "js-yaml": "^4.0.0", "jschardet": "^2.2.1" @@ -39,9 +40,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + "version": "16.18.39", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.39.tgz", + "integrity": "sha512-8q9ZexmdYYyc5/cfujaXb4YOucpQxAV4RMG0himLyDUOEr8Mr79VrqsFI+cQ2M2h89YIuy95lbxuYjxT4Hk4kQ==" }, "node_modules/@types/qs": { "version": "6.9.7", @@ -64,15 +65,15 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "node_modules/azure-pipelines-task-lib": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-3.1.10.tgz", - "integrity": "sha512-S5iH1mD9G7boOV0kjVsFkqlz/6FOZjQAajshj3ajzQK9Wr3XRq9JK9+grJP4ityG6of28X2XWpieFdJLhnWLoA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-4.4.0.tgz", + "integrity": "sha512-JgtxfjxjRA+KWY0Q5UC1fo48nkbVxFHgKEuasKdJMSNxHydOyNlB5MNw4UTiTXp9b0nnqKeOQOBn5RN3go3aPg==", "dependencies": { - "minimatch": "3.0.4", - "mockery": "^1.7.0", + "minimatch": "3.0.5", + "mockery": "^2.1.0", "q": "^1.5.1", "semver": "^5.1.0", - "shelljs": "^0.8.4", + "shelljs": "^0.8.5", "sync-request": "6.1.0", "uuid": "^3.0.1" } @@ -263,6 +264,11 @@ "@types/node": "^10.0.3" } }, + "node_modules/http-response-object/node_modules/@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -351,9 +357,9 @@ } }, "node_modules/minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", "dependencies": { "brace-expansion": "^1.1.7" }, @@ -362,9 +368,9 @@ } }, "node_modules/mockery": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/mockery/-/mockery-1.7.0.tgz", - "integrity": "sha1-9O3g2HUMHJcnwnLqLGBiniyaHE8=" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mockery/-/mockery-2.1.0.tgz", + "integrity": "sha512-9VkOmxKlWXoDO/h1jDZaS4lH33aWfRiJiNT/tKj+8OGzrcFDLo8d0syGdbsc3Bc4GvRXPb+NMMvojotmuGJTvA==" }, "node_modules/object-inspect": { "version": "1.12.0", @@ -639,9 +645,9 @@ "dev": true }, "@types/node": { - "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + "version": "16.18.39", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.39.tgz", + "integrity": "sha512-8q9ZexmdYYyc5/cfujaXb4YOucpQxAV4RMG0himLyDUOEr8Mr79VrqsFI+cQ2M2h89YIuy95lbxuYjxT4Hk4kQ==" }, "@types/qs": { "version": "6.9.7", @@ -664,15 +670,15 @@ "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" }, "azure-pipelines-task-lib": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-3.1.10.tgz", - "integrity": "sha512-S5iH1mD9G7boOV0kjVsFkqlz/6FOZjQAajshj3ajzQK9Wr3XRq9JK9+grJP4ityG6of28X2XWpieFdJLhnWLoA==", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/azure-pipelines-task-lib/-/azure-pipelines-task-lib-4.4.0.tgz", + "integrity": "sha512-JgtxfjxjRA+KWY0Q5UC1fo48nkbVxFHgKEuasKdJMSNxHydOyNlB5MNw4UTiTXp9b0nnqKeOQOBn5RN3go3aPg==", "requires": { - "minimatch": "3.0.4", - "mockery": "^1.7.0", + "minimatch": "3.0.5", + "mockery": "^2.1.0", "q": "^1.5.1", "semver": "^5.1.0", - "shelljs": "^0.8.4", + "shelljs": "^0.8.5", "sync-request": "6.1.0", "uuid": "^3.0.1" } @@ -822,6 +828,13 @@ "integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==", "requires": { "@types/node": "^10.0.3" + }, + "dependencies": { + "@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + } } }, "iconv-lite": { @@ -891,17 +904,17 @@ } }, "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.5.tgz", + "integrity": "sha512-tUpxzX0VAzJHjLu0xUfFv1gwVp9ba3IOuRAVH2EGuRW8a5emA2FlACLqiT/lDVtS1W+TGNwqz3sWaNyLgDJWuw==", "requires": { "brace-expansion": "^1.1.7" } }, "mockery": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/mockery/-/mockery-1.7.0.tgz", - "integrity": "sha1-9O3g2HUMHJcnwnLqLGBiniyaHE8=" + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mockery/-/mockery-2.1.0.tgz", + "integrity": "sha512-9VkOmxKlWXoDO/h1jDZaS4lH33aWfRiJiNT/tKj+8OGzrcFDLo8d0syGdbsc3Bc4GvRXPb+NMMvojotmuGJTvA==" }, "object-inspect": { "version": "1.12.0", diff --git a/tasks/ReplaceTokensV5/package.json b/tasks/ReplaceTokensV5/package.json index 7222f86..42b7d96 100644 --- a/tasks/ReplaceTokensV5/package.json +++ b/tasks/ReplaceTokensV5/package.json @@ -2,7 +2,8 @@ "name": "replacetokens-v5", "author": "Guillaume Rouchon", "dependencies": { - "azure-pipelines-task-lib": "^3.1.10", + "@types/node": "^16.11.39", + "azure-pipelines-task-lib": "^4.1.0", "iconv-lite": "^0.4.15", "js-yaml": "^4.0.0", "jschardet": "^2.2.1" diff --git a/tasks/ReplaceTokensV5/task.json b/tasks/ReplaceTokensV5/task.json index 8d9ffcc..a6cd219 100644 --- a/tasks/ReplaceTokensV5/task.json +++ b/tasks/ReplaceTokensV5/task.json @@ -1,348 +1,353 @@ { - "id": "A8515EC8-7254-4FFD-912C-86772E2B5962", - "name": "replacetokens", - "friendlyName": "Replace Tokens", - "description": "Replace tokens in files", - "helpMarkDown": "[Learn more about this task](https://github.com/qetza/vsts-replacetokens-task/blob/master/tasks/ReplaceTokensV5/README.md)", - "category": "Utility", - "visibility": [ - "Build", - "Release" - ], - "author": "Guillaume Rouchon", - "version": { - "Major": 5, - "Minor": 2, - "Patch": 0 - }, - "releaseNotes": "Migrate to Node10 handler (breaking change).", - "instanceNameFormat": "Replace tokens in $(targetFiles)", - "minimumAgentVersion": "2.144.0", - "groups": [ - { - "name": "validations", - "displayName": "Validations", - "isExpanded": true - }, - { - "name": "transforms", - "displayName": "Transformations", - "isExpanded": false - }, - { - "name": "variables", - "displayName": "Variables", - "isExpanded": false - }, - { - "name": "advanced", - "displayName": "Advanced", - "isExpanded": false - } - ], - "inputs": [ - { - "name": "rootDirectory", - "type": "filePath", - "label": "Root directory", - "defaultValue": "", - "required": false, - "helpMarkDown": "Base directory for searching files. If not specified the default working directory will be used." - }, - { - "name": "targetFiles", - "type": "multiLine", - "label": "Target files", - "defaultValue": "**/*.config", - "required": true, - "helpMarkDown": "Absolute or relative comma or newline-separated paths to the files to replace tokens (wildcards can be used).
Syntax: {file path}[ => {output path}]
Example: 'web.config' will replace tokens in web.config and update the file.
Example: 'config\\*.tokenized.config => *.config' will replace tokens in config\\{filename}.tokenized.config and save the result in config\\{filename}.config." - }, - { - "name": "encoding", - "type": "pickList", - "label": "Files encoding", - "defaultValue": "auto", - "required": true, - "options": { - "auto": "auto", - "ascii": "ascii", - "utf-7": "utf-7", - "utf-8": "utf-8", - "utf-16le": "utf-16", - "utf-16be": "utf-16 (big endian)", - "win1252": "windows 1252", - "iso88591": "iso 8859-1" - }, - "helpMarkDown": "Specify the files encoding.
The 'auto' value will determine the encoding based on the Byte Order Mark (BOM) if present; otherwise it will use ascii." - }, - { - "name": "tokenPattern", - "type": "pickList", - "label": "Token pattern", - "defaultValue": "default", - "required": true, - "options": { - "default": "#{ ... }#", - "rm": "__ ... __", - "octopus": "#{ ... }", - "azpipelines": "$( ... )", - "doublebraces": "{{ ... }}", - "custom": "custom" - }, - "helpMarkDown": "Specify the token pattern. Use custom to specify your own prefix and suffix" - }, - { - "name": "tokenPrefix", - "type": "string", - "label": "Token prefix", - "defaultValue": "#{", - "required": true, - "visibleRule": "tokenPattern == custom", - "helpMarkDown": "The prefix of the tokens to search in the target files." - }, - { - "name": "tokenSuffix", - "type": "string", - "label": "Token suffix", - "defaultValue": "}#", - "required": true, - "visibleRule": "tokenPattern == custom", - "helpMarkDown": "The suffix of the tokens to search in the target files." - }, - { - "name": "writeBOM", - "type": "boolean", - "label": "Write unicode BOM", - "defaultValue": "true", - "required": true, - "helpMarkDown": "If checked writes an unicode Byte Order Mark (BOM).", - "visibleRule": "encoding != ascii && encoding != win1252 && encoding != iso88591" - }, - { - "name": "escapeType", - "type": "pickList", - "defaultValue": "auto", - "label": "Escape values type", - "helpMarkDown": "Specify how to escape variable values.", - "options": { - "auto": "auto", - "none": "no escaping", - "json": "json", - "xml": "xml", - "custom": "custom" - } - }, - { - "name": "escapeChar", - "type": "string", - "label": "Escape character", - "visibleRule": "escapeType == custom", - "helpMarkDown": "The escape character to use when escaping characters in the variable values." - }, - { - "name": "charsToEscape", - "type": "string", - "label": "Characters to escape", - "visibleRule": "escapeType == custom", - "helpMarkDown": "Characters in variable values to escape before replacing tokens." - }, - { - "name": "verbosity", - "type": "pickList", - "label": "Verbosity", - "defaultValue": "normal", - "options": { - "normal": "normal", - "detailed": "detailed", - "off": "off" - }, - "helpMarkDown": "Specify the logs verbosity level. (error and system debug are always on)" - }, - { - "name": "actionOnMissing", - "type": "pickList", - "label": "Action on missing variable", - "defaultValue": "warn", - "groupName": "validations", - "required": true, - "options": { - "continue": "silently continue", - "warn": "log warning", - "fail": "fail" - }, - "helpMarkDown": "Specify the action on a missing variable." - }, - { - "name": "keepToken", - "type": "boolean", - "label": "Keep token for missing variable", - "defaultValue": "false", - "groupName": "validations", - "required": true, - "helpMarkDown": "If checked tokens with missing variables will not be replaced by empty string." - }, - { - "name": "actionOnNoFiles", - "type": "pickList", - "label": "Action on no file processed", - "defaultValue": "continue", - "groupName": "validations", - "required": true, - "options": { - "continue": "silently continue", - "warn": "log warning", - "fail": "fail" - }, - "helpMarkDown": "Specify the action when no file was processed." - }, - { - "name": "enableTransforms", - "type": "boolean", - "label": "Enable transformations", - "defaultValue": "false", - "groupName": "transforms", - "required": true, - "helpMarkDown": "If checked transformations can be applied on variable values.
Syntax: {token prefix}{transformation name}{transform prefix}{token}{transform suffix}{token suffix}
Example: #{lower(MyVar)}#" - }, - { - "name": "transformPrefix", - "type": "string", - "label": "Transform prefix", - "defaultValue": "(", - "groupName": "transforms", - "required": true, - "helpMarkDown": "The prefix between transform name and token name.", - "visibleRule": "enableTransforms == true" - }, - { - "name": "transformSuffix", - "type": "string", - "label": "Transform suffix", - "defaultValue": ")", - "groupName": "transforms", - "required": true, - "helpMarkDown": "The suffix after the token name.", - "visibleRule": "enableTransforms == true" - }, - { - "name": "variableFiles", - "type": "multiLine", - "label": "Files (JSON or YAML)", - "defaultValue": "", - "groupName": "variables", - "required": false, - "helpMarkDown": "Absolute or relative comma or newline-separated paths to the files containing additional variables (wildcards can be used). YAML files must have the .yml or .yaml extension otherwise the file is treated as JSON." - }, - { - "name": "inlineVariables", - "type": "multiLine", - "label": "Inline variables (YAML syntax)", - "defaultValue": "", - "groupName": "variables", - "required": false, - "helpMarkDown": "A YAML formatted string containing inline variables." - }, - { - "name": "variableSeparator", - "type": "string", - "label": "Separator", - "defaultValue": ".", - "groupName": "variables", - "required": false, - "helpMarkDown": "The separtor to use in variable names for nested objects in inline variables or variable files.
Example: {'My':{'Value':'Hello World!'}} will create a variable 'My.Value' with the value 'Hello World!'" - }, - { - "name": "enableRecursion", - "type": "boolean", - "label": "Enable recursion in values", - "defaultValue": "false", - "groupName": "advanced", - "required": true, - "helpMarkDown": "If checked token replacement (with transformation) will be run on values.
Example: \"Say: #{value1}#\" with value1 = \"hello #{upper(value2)}#\" and value2 = \"world!\" will result in \"hello WORLD!\"." - }, - { - "name": "useLegacyPattern", - "type": "boolean", - "label": "Use legacy pattern", - "defaultValue": "false", - "groupName": "advanced", - "required": true, - "helpMarkDown": "If checked whitespaces between the token prefix/suffix and the variable name are not ignored." - }, - { - "name": "useLegacyEmptyFeature", - "type": "boolean", - "label": "Use legacy empty/default feature", - "defaultValue": "true", - "groupName": "advanced", - "required": false, - "helpMarkDown": "If check use the old empty & default values features." - }, - { - "name": "useDefaultValue", - "type": "boolean", - "label": "Use default value", - "defaultValue": "false", - "groupName": "advanced", - "required": false, - "helpMarkDown": "If check replace variable not found with a default value.", - "visibleRule": "useLegacyEmptyFeature == false" - }, - { - "name": "emptyValue", - "type": "string", - "label": "Empty value", - "defaultValue": "(empty)", - "groupName": "advanced", - "required": false, - "helpMarkDown": "The variable value which will be replaced by an empty string.", - "visibleRule": "useLegacyEmptyFeature == true" - }, - { - "name": "defaultValue", - "type": "string", - "label": "Default value", - "defaultValue": "", - "groupName": "advanced", - "required": false, - "helpMarkDown": "The value to be used if a variable is not found. Do not set to disable default value feature with the legacy feature.", - "visibleRule": "useLegacyEmptyFeature == true || useDefaultValue == true" - }, - { - "name": "enableTelemetry", - "type": "boolean", - "label": "Send anonymous usage telemetry", - "defaultValue": "true", - "groupName": "advanced", - "required": true, - "helpMarkDown": "If checked anonymous usage data will be sent to the task author for task usage analysis." - } - ], - "outputVariables": [ - { - "name": "tokenReplacedCount", - "description": "Total number of tokens replaced." - }, - { - "name": "tokenFoundCount", - "description": "Total number of tokens found." - }, - { - "name": "fileProcessedCount", - "description": "Total number of files processed." - }, - { - "name": "transformExecutedCount", - "description": "Total number of transformations executed." - }, - { - "name": "defaultValueCount", - "description": "Total number of default value used." - } - ], - "execution": { - "Node10": { - "target": "index.js" - } + "id": "A8515EC8-7254-4FFD-912C-86772E2B5962", + "name": "replacetokens", + "friendlyName": "Replace Tokens", + "description": "Replace tokens in files", + "helpMarkDown": "[Learn more about this task](https://github.com/qetza/vsts-replacetokens-task/blob/master/tasks/ReplaceTokensV5/README.md)", + "category": "Utility", + "visibility": [ + "Build", + "Release" + ], + "author": "Guillaume Rouchon", + "version": { + "Major": 5, + "Minor": 2, + "Patch": 0 + }, + "releaseNotes": "Migrate to Node10 handler (breaking change).
Add Node16 handler.", + "instanceNameFormat": "Replace tokens in $(targetFiles)", + "minimumAgentVersion": "2.144.0", + "groups": [ + { + "name": "validations", + "displayName": "Validations", + "isExpanded": true + }, + { + "name": "transforms", + "displayName": "Transformations", + "isExpanded": false + }, + { + "name": "variables", + "displayName": "Variables", + "isExpanded": false + }, + { + "name": "advanced", + "displayName": "Advanced", + "isExpanded": false + } + ], + "inputs": [ + { + "name": "rootDirectory", + "type": "filePath", + "label": "Root directory", + "defaultValue": "", + "required": false, + "helpMarkDown": "Base directory for searching files. If not specified the default working directory will be used." + }, + { + "name": "targetFiles", + "type": "multiLine", + "label": "Target files", + "defaultValue": "**/*.config", + "required": true, + "helpMarkDown": "Absolute or relative comma or newline-separated paths to the files to replace tokens (wildcards can be used).
Syntax: {file path}[ => {output path}]
Example: 'web.config' will replace tokens in web.config and update the file.
Example: 'config\\*.tokenized.config => *.config' will replace tokens in config\\{filename}.tokenized.config and save the result in config\\{filename}.config." + }, + { + "name": "encoding", + "type": "pickList", + "label": "Files encoding", + "defaultValue": "auto", + "required": true, + "options": { + "auto": "auto", + "ascii": "ascii", + "utf-7": "utf-7", + "utf-8": "utf-8", + "utf-16le": "utf-16", + "utf-16be": "utf-16 (big endian)", + "win1252": "windows 1252", + "iso88591": "iso 8859-1" + }, + "helpMarkDown": "Specify the files encoding.
The 'auto' value will determine the encoding based on the Byte Order Mark (BOM) if present; otherwise it will use ascii." + }, + { + "name": "tokenPattern", + "type": "pickList", + "label": "Token pattern", + "defaultValue": "default", + "required": true, + "options": { + "default": "#{ ... }#", + "rm": "__ ... __", + "octopus": "#{ ... }", + "azpipelines": "$( ... )", + "doublebraces": "{{ ... }}", + "custom": "custom" + }, + "helpMarkDown": "Specify the token pattern. Use custom to specify your own prefix and suffix" + }, + { + "name": "tokenPrefix", + "type": "string", + "label": "Token prefix", + "defaultValue": "#{", + "required": true, + "visibleRule": "tokenPattern == custom", + "helpMarkDown": "The prefix of the tokens to search in the target files." + }, + { + "name": "tokenSuffix", + "type": "string", + "label": "Token suffix", + "defaultValue": "}#", + "required": true, + "visibleRule": "tokenPattern == custom", + "helpMarkDown": "The suffix of the tokens to search in the target files." + }, + { + "name": "writeBOM", + "type": "boolean", + "label": "Write unicode BOM", + "defaultValue": "true", + "required": true, + "helpMarkDown": "If checked writes an unicode Byte Order Mark (BOM).", + "visibleRule": "encoding != ascii && encoding != win1252 && encoding != iso88591" + }, + { + "name": "escapeType", + "type": "pickList", + "defaultValue": "auto", + "label": "Escape values type", + "helpMarkDown": "Specify how to escape variable values.", + "options": { + "auto": "auto", + "none": "no escaping", + "json": "json", + "xml": "xml", + "custom": "custom" + } + }, + { + "name": "escapeChar", + "type": "string", + "label": "Escape character", + "visibleRule": "escapeType == custom", + "helpMarkDown": "The escape character to use when escaping characters in the variable values." + }, + { + "name": "charsToEscape", + "type": "string", + "label": "Characters to escape", + "visibleRule": "escapeType == custom", + "helpMarkDown": "Characters in variable values to escape before replacing tokens." + }, + { + "name": "verbosity", + "type": "pickList", + "label": "Verbosity", + "defaultValue": "normal", + "options": { + "normal": "normal", + "detailed": "detailed", + "off": "off" + }, + "helpMarkDown": "Specify the logs verbosity level. (error and system debug are always on)" + }, + { + "name": "actionOnMissing", + "type": "pickList", + "label": "Action on missing variable", + "defaultValue": "warn", + "groupName": "validations", + "required": true, + "options": { + "continue": "silently continue", + "warn": "log warning", + "fail": "fail" + }, + "helpMarkDown": "Specify the action on a missing variable." + }, + { + "name": "keepToken", + "type": "boolean", + "label": "Keep token for missing variable", + "defaultValue": "false", + "groupName": "validations", + "required": true, + "helpMarkDown": "If checked tokens with missing variables will not be replaced by empty string." + }, + { + "name": "actionOnNoFiles", + "type": "pickList", + "label": "Action on no file processed", + "defaultValue": "continue", + "groupName": "validations", + "required": true, + "options": { + "continue": "silently continue", + "warn": "log warning", + "fail": "fail" + }, + "helpMarkDown": "Specify the action when no file was processed." + }, + { + "name": "enableTransforms", + "type": "boolean", + "label": "Enable transformations", + "defaultValue": "false", + "groupName": "transforms", + "required": true, + "helpMarkDown": "If checked transformations can be applied on variable values.
Syntax: {token prefix}{transformation name}{transform prefix}{token}{transform suffix}{token suffix}
Example: #{lower(MyVar)}#" + }, + { + "name": "transformPrefix", + "type": "string", + "label": "Transform prefix", + "defaultValue": "(", + "groupName": "transforms", + "required": true, + "helpMarkDown": "The prefix between transform name and token name.", + "visibleRule": "enableTransforms == true" + }, + { + "name": "transformSuffix", + "type": "string", + "label": "Transform suffix", + "defaultValue": ")", + "groupName": "transforms", + "required": true, + "helpMarkDown": "The suffix after the token name.", + "visibleRule": "enableTransforms == true" + }, + { + "name": "variableFiles", + "type": "multiLine", + "label": "Files (JSON or YAML)", + "defaultValue": "", + "groupName": "variables", + "required": false, + "helpMarkDown": "Absolute or relative comma or newline-separated paths to the files containing additional variables (wildcards can be used). YAML files must have the .yml or .yaml extension otherwise the file is treated as JSON." + }, + { + "name": "inlineVariables", + "type": "multiLine", + "label": "Inline variables (YAML syntax)", + "defaultValue": "", + "groupName": "variables", + "required": false, + "helpMarkDown": "A YAML formatted string containing inline variables." + }, + { + "name": "variableSeparator", + "type": "string", + "label": "Separator", + "defaultValue": ".", + "groupName": "variables", + "required": false, + "helpMarkDown": "The separtor to use in variable names for nested objects in inline variables or variable files.
Example: {'My':{'Value':'Hello World!'}} will create a variable 'My.Value' with the value 'Hello World!'" + }, + { + "name": "enableRecursion", + "type": "boolean", + "label": "Enable recursion in values", + "defaultValue": "false", + "groupName": "advanced", + "required": true, + "helpMarkDown": "If checked token replacement (with transformation) will be run on values.
Example: \"Say: #{value1}#\" with value1 = \"hello #{upper(value2)}#\" and value2 = \"world!\" will result in \"hello WORLD!\"." + }, + { + "name": "useLegacyPattern", + "type": "boolean", + "label": "Use legacy pattern", + "defaultValue": "false", + "groupName": "advanced", + "required": true, + "helpMarkDown": "If checked whitespaces between the token prefix/suffix and the variable name are not ignored." + }, + { + "name": "useLegacyEmptyFeature", + "type": "boolean", + "label": "Use legacy empty/default feature", + "defaultValue": "true", + "groupName": "advanced", + "required": false, + "helpMarkDown": "If check use the old empty & default values features." + }, + { + "name": "useDefaultValue", + "type": "boolean", + "label": "Use default value", + "defaultValue": "false", + "groupName": "advanced", + "required": false, + "helpMarkDown": "If check replace variable not found with a default value.", + "visibleRule": "useLegacyEmptyFeature == false" + }, + { + "name": "emptyValue", + "type": "string", + "label": "Empty value", + "defaultValue": "(empty)", + "groupName": "advanced", + "required": false, + "helpMarkDown": "The variable value which will be replaced by an empty string.", + "visibleRule": "useLegacyEmptyFeature == true" + }, + { + "name": "defaultValue", + "type": "string", + "label": "Default value", + "defaultValue": "", + "groupName": "advanced", + "required": false, + "helpMarkDown": "The value to be used if a variable is not found. Do not set to disable default value feature with the legacy feature.", + "visibleRule": "useLegacyEmptyFeature == true || useDefaultValue == true" + }, + { + "name": "enableTelemetry", + "type": "boolean", + "label": "Send anonymous usage telemetry", + "defaultValue": "true", + "groupName": "advanced", + "required": true, + "helpMarkDown": "If checked anonymous usage data will be sent to the task author for task usage analysis." + } + ], + "outputVariables": [ + { + "name": "tokenReplacedCount", + "description": "Total number of tokens replaced." + }, + { + "name": "tokenFoundCount", + "description": "Total number of tokens found." + }, + { + "name": "fileProcessedCount", + "description": "Total number of files processed." + }, + { + "name": "transformExecutedCount", + "description": "Total number of transformations executed." + }, + { + "name": "defaultValueCount", + "description": "Total number of default value used." + } + ], + "execution": { + "Node10": { + "target": "index.js", + "argumentFormat": "" + }, + "Node16": { + "target": "index.js", + "argumentFormat": "" } -} + } +} \ No newline at end of file