From 9896b84c749f159c0c41bfb972a988bee3dc1bed Mon Sep 17 00:00:00 2001 From: Cyprien Autexier <2660262+sandorfr@users.noreply.github.com> Date: Thu, 15 Nov 2018 11:08:21 +1100 Subject: [PATCH 1/4] cleanup task.loc.json --- Tasks/Yarn/task.loc.json | 135 +++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 75 deletions(-) diff --git a/Tasks/Yarn/task.loc.json b/Tasks/Yarn/task.loc.json index 148a27a..21ee076 100644 --- a/Tasks/Yarn/task.loc.json +++ b/Tasks/Yarn/task.loc.json @@ -6,100 +6,91 @@ "helpMarkDown": "ms-resource:loc.helpMarkDown", "category": "Utility", "author": "Geek Learning", - "preview": "true", - "visibility": [ - "Build", - "Release" - ], + "visibility": ["Build", "Release"], "version": { "Major": 0, "Minor": 0, "Patch": 1 }, - "runsOn": [ - "Agent", - "DeploymentGroup" - ], - "demands": [ - "npm", - "yarn" - ], + "runsOn": ["Agent", "DeploymentGroup"], + "demands": ["npm", "yarn"], "minimumAgentVersion": "1.91.0", "instanceNameFormat": "ms-resource:loc.instanceNameFormat", "groups": [ { - "name": "install", - "displayName": "Install Options", - "isExpanded": false + "name": "install", + "displayName": "Install Options", + "isExpanded": false }, { - "name": "customRegistries", - "displayName": "Custom registries and authentication", - "isExpanded": false + "name": "customRegistries", + "displayName": "Custom registries and authentication", + "isExpanded": false } -], -"inputs": [ + ], + "inputs": [ { - "name": "ProjectDirectory", - "type": "filePath", - "label": "Project Directory", - "defaultValue": "", - "required": false, - "helpMarkDown": "Source directory" + "name": "ProjectDirectory", + "type": "filePath", + "label": "Project Directory", + "defaultValue": "", + "required": false, + "helpMarkDown": "Source directory" }, { - "name": "Arguments", - "type": "string", - "label": "Arguments", - "defaultValue": "", - "required": false, - "helpMarkDown": "Additionals arguments" + "name": "Arguments", + "type": "string", + "label": "Arguments", + "defaultValue": "", + "required": false, + "helpMarkDown": "Additionals arguments" }, { - "name": "ProductionMode", - "type": "boolean", - "label": "Production Install", - "defaultValue": false, - "required": false, - "groupName": "install", - "helpMarkDown": "appends --production argument" + "name": "ProductionMode", + "type": "boolean", + "label": "Production Install", + "defaultValue": false, + "required": false, + "groupName": "install", + "helpMarkDown": "appends --production argument" }, { - "groupName": "customRegistries", - "name": "customRegistry", - "label": "Registries to use", - "helpMarkDown": "You can either commit a .npmrc file to your source code repository and set its path here or select a registry from VSTS here.", - "type": "radio", - "options": { - "useNpmrc": "Registries in my .npmrc", - "useFeed": "Registry I select here" - }, - "defaultValue": "useNpmrc" + "groupName": "customRegistries", + "name": "customRegistry", + "label": "Registries to use", + "helpMarkDown": "You can either commit a .npmrc file to your source code repository and set its path here or select a registry from VSTS here.", + "type": "radio", + "options": { + "useNpmrc": "Registries in my .npmrc", + "useFeed": "Registry I select here" + }, + "defaultValue": "useNpmrc" }, { - "groupName": "customRegistries", - "name": "customFeed", - "label": "Use packages from this VSTS/TFS registry", - "helpMarkDown": "Include the selected feed in the generated .npmrc.", - "type": "pickList", - "visibleRule": "customRegistry = useFeed", - "required": true + "groupName": "customRegistries", + "name": "customFeed", + "label": "Use packages from this VSTS/TFS registry", + "helpMarkDown": "Include the selected feed in the generated .npmrc.", + "type": "pickList", + "visibleRule": "customRegistry = useFeed", + "required": true }, { - "groupName": "customRegistries", - "name": "customEndpoint", - "label": "Credentials for registries outside this account/collection", - "helpMarkDown": "Credentials to use for external registries located in the project's .npmrc. For registries in this account/collection, leave this blank; the build’s credentials are used automatically.", - "type": "connectedService:externalnpmregistry", - "visibleRule": "customRegistry = useNpmrc", - "properties": { - "MultiSelectFlatList": "true" - } + "groupName": "customRegistries", + "name": "customEndpoint", + "label": "Credentials for registries outside this account/collection", + "helpMarkDown": "Credentials to use for external registries located in the project's .npmrc. For registries in this account/collection, leave this blank; the build’s credentials are used automatically.", + "type": "connectedService:externalnpmregistry", + "visibleRule": "customRegistry = useNpmrc", + "properties": { + "MultiSelectFlatList": "true" + } } -], + ], "execution": { "Node": { - "target": "npmauth.js" + "target": "yarnTask.js", + "argumentFormat": "" } }, "messages": { @@ -121,11 +112,5 @@ "NoIndexJsonFile": "ms-resource:loc.messages.NoIndexJsonFile", "RevertedChangesToNpmrc": "ms-resource:loc.messages.RevertedChangesToNpmrc", "NpmrcDoesNotExist": "ms-resource:loc.messages.NpmrcDoesNotExist" - }, - "postjobexecution": { - "Node": { - "target": "npmauthcleanup.js", - "argumentFormat": "" - } } -} \ No newline at end of file +} From ec9d1ea26bd3bce2a3ebf888aecc310488854e20 Mon Sep 17 00:00:00 2001 From: Cyprien Autexier <2660262+sandorfr@users.noreply.github.com> Date: Thu, 15 Nov 2018 11:19:12 +1100 Subject: [PATCH 2/4] remove npm demand in the task.loc.json --- Tasks/Yarn/task.loc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/Yarn/task.loc.json b/Tasks/Yarn/task.loc.json index 21ee076..4fda10d 100644 --- a/Tasks/Yarn/task.loc.json +++ b/Tasks/Yarn/task.loc.json @@ -13,7 +13,7 @@ "Patch": 1 }, "runsOn": ["Agent", "DeploymentGroup"], - "demands": ["npm", "yarn"], + "demands": ["yarn"], "minimumAgentVersion": "1.91.0", "instanceNameFormat": "ms-resource:loc.instanceNameFormat", "groups": [ From 698f3663b8da32a5c21ff34eca7b119da0bd52c8 Mon Sep 17 00:00:00 2001 From: Cyprien Autexier <2660262+sandorfr@users.noreply.github.com> Date: Fri, 16 Nov 2018 10:19:18 +1100 Subject: [PATCH 3/4] add data sources binding to task.loc.json --- Tasks/Yarn/task.loc.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Tasks/Yarn/task.loc.json b/Tasks/Yarn/task.loc.json index 4fda10d..2e5acc0 100644 --- a/Tasks/Yarn/task.loc.json +++ b/Tasks/Yarn/task.loc.json @@ -87,6 +87,22 @@ } } ], + "dataSourceBindings": [ + { + "target": "customFeed", + "endpointId": "tfs:feed", + "endpointUrl": "{{endpoint.url}}/_apis/packaging/feeds", + "resultSelector": "jsonpath:$.value[*]", + "resultTemplate": "{ \"Value\": \"{{{id}}}\", \"DisplayValue\": \"{{{name}}}\"}" + }, + { + "target": "publishFeed", + "endpointId": "tfs:feed", + "endpointUrl": "{{endpoint.url}}/_apis/packaging/feeds", + "resultSelector": "jsonpath:$.value[*]", + "resultTemplate": "{ \"Value\": \"{{{id}}}\", \"DisplayValue\": \"{{{name}}}\"}" + } + ], "execution": { "Node": { "target": "yarnTask.js", From 0919dd06c6727cae8240621c3d9cf57d517ae2b7 Mon Sep 17 00:00:00 2001 From: Cyprien Autexier <2660262+sandorfr@users.noreply.github.com> Date: Fri, 16 Nov 2018 10:40:17 +1100 Subject: [PATCH 4/4] reformat and cleanup --- Tasks/Yarn/task.json | 257 ++++++++++++++++++--------------------- Tasks/Yarn/task.loc.json | 7 -- 2 files changed, 121 insertions(+), 143 deletions(-) diff --git a/Tasks/Yarn/task.json b/Tasks/Yarn/task.json index 54cdcb2..040e573 100644 --- a/Tasks/Yarn/task.json +++ b/Tasks/Yarn/task.json @@ -1,140 +1,125 @@ { - "id": "57066373-3f34-492b-941a-d66dd6b079c4", - "name": "Yarn", - "friendlyName": "Yarn task", - "description": "Executes Yarn", - "helpMarkDown": "[More Information](https://github.com/geeklearningio/gl-vsts-tasks-yarn/wiki/Yarn) (Version #{Version}#).\n\nDear Angular and Ember CLI users, please check our [known issues](https://github.com/geeklearningio/gl-vsts-tasks-yarn/wiki/Known-Issues)", - "category": "Utility", - "author": "Geek Learning", - "visibility": [ - "Build", - "Release" - ], - "version": { - "Major": 0, - "Minor": 0, - "Patch": 0 + "id": "57066373-3f34-492b-941a-d66dd6b079c4", + "name": "Yarn", + "friendlyName": "Yarn task", + "description": "Executes Yarn", + "helpMarkDown": "[More Information](https://github.com/geeklearningio/gl-vsts-tasks-yarn/wiki/Yarn) (Version #{Version}#).\n\nDear Angular and Ember CLI users, please check our [known issues](https://github.com/geeklearningio/gl-vsts-tasks-yarn/wiki/Known-Issues)", + "category": "Utility", + "author": "Geek Learning", + "visibility": ["Build", "Release"], + "version": { + "Major": 0, + "Minor": 0, + "Patch": 0 + }, + "runsOn": ["Agent", "DeploymentGroup"], + "demands": ["yarn"], + "minimumAgentVersion": "1.91.0", + "instanceNameFormat": "Yarn $(Arguments)", + "groups": [ + { + "name": "install", + "displayName": "Install Options", + "isExpanded": false }, - "runsOn": [ - "Agent", - "DeploymentGroup" - ], - "demands": [ - "yarn" - ], - "minimumAgentVersion": "1.91.0", - "instanceNameFormat": "Yarn $(Arguments)", - "groups": [ - { - "name": "install", - "displayName": "Install Options", - "isExpanded": false - }, - { - "name": "customRegistries", - "displayName": "Custom registries and authentication", - "isExpanded": false - } - ], - "inputs": [ - { - "name": "ProjectDirectory", - "type": "filePath", - "label": "Project Directory", - "defaultValue": "", - "required": false, - "helpMarkDown": "Source directory" - }, - { - "name": "Arguments", - "type": "string", - "label": "Arguments", - "defaultValue": "", - "required": false, - "helpMarkDown": "Additionals arguments" - }, - { - "name": "ProductionMode", - "type": "boolean", - "label": "Production Install", - "defaultValue": false, - "required": false, - "groupName": "install", - "helpMarkDown": "appends --production argument" - }, - { - "groupName": "customRegistries", - "name": "customRegistry", - "label": "Registries to use", - "helpMarkDown": "You can either commit a .npmrc file to your source code repository and set its path here or select a registry from VSTS here.", - "type": "radio", - "options": { - "useNpmrc": "Registries in my .npmrc", - "useFeed": "Registry I select here" - }, - "defaultValue": "useNpmrc" - }, - { - "groupName": "customRegistries", - "name": "customFeed", - "label": "Use packages from this VSTS/TFS registry", - "helpMarkDown": "Include the selected feed in the generated .npmrc.", - "type": "pickList", - "visibleRule": "customRegistry = useFeed", - "required": true - }, - { - "groupName": "customRegistries", - "name": "customEndpoint", - "label": "Credentials for registries outside this account/collection", - "helpMarkDown": "Credentials to use for external registries located in the project's .npmrc. For registries in this account/collection, leave this blank; the build’s credentials are used automatically.", - "type": "connectedService:externalnpmregistry", - "visibleRule": "customRegistry = useNpmrc", - "properties": { - "MultiSelectFlatList": "true" - } - } - ], - "dataSourceBindings": [ - { - "target": "customFeed", - "endpointId": "tfs:feed", - "endpointUrl": "{{endpoint.url}}/_apis/packaging/feeds", - "resultSelector": "jsonpath:$.value[*]", - "resultTemplate": "{ \"Value\": \"{{{id}}}\", \"DisplayValue\": \"{{{name}}}\"}" - }, - { - "target": "publishFeed", - "endpointId": "tfs:feed", - "endpointUrl": "{{endpoint.url}}/_apis/packaging/feeds", - "resultSelector": "jsonpath:$.value[*]", - "resultTemplate": "{ \"Value\": \"{{{id}}}\", \"DisplayValue\": \"{{{name}}}\"}" - } - ], - "execution": { - "Node": { - "target": "yarnTask.js", - "argumentFormat": "" - } + { + "name": "customRegistries", + "displayName": "Custom registries and authentication", + "isExpanded": false + } + ], + "inputs": [ + { + "name": "ProjectDirectory", + "type": "filePath", + "label": "Project Directory", + "defaultValue": "", + "required": false, + "helpMarkDown": "Source directory" + }, + { + "name": "Arguments", + "type": "string", + "label": "Arguments", + "defaultValue": "", + "required": false, + "helpMarkDown": "Additionals arguments" + }, + { + "name": "ProductionMode", + "type": "boolean", + "label": "Production Install", + "defaultValue": false, + "required": false, + "groupName": "install", + "helpMarkDown": "appends --production argument" + }, + { + "groupName": "customRegistries", + "name": "customRegistry", + "label": "Registries to use", + "helpMarkDown": "You can either commit a .npmrc file to your source code repository and set its path here or select a registry from VSTS here.", + "type": "radio", + "options": { + "useNpmrc": "Registries in my .npmrc", + "useFeed": "Registry I select here" + }, + "defaultValue": "useNpmrc" }, - "messages": { - "FoundBuildCredentials": "Found build credentials", - "NoBuildCredentials": "Could not find build credentials", - "ServiceEndpointNotDefined": "Couldn't find Service Endpoint, make sure the selected endpoint still exists.", - "NpmrcNotNpmrc": "The file you selected to authenticate (%s) is not a valid .npmrc file.", - "ServiceEndpointUrlNotDefined": "Couldn't find Url for Service Endpoint, make sure Service Endpoint is correctly configured.", - "SavingFile": "Saving file %s", - "RestoringFile": "Restoring file %s", - "AddingAuthRegistry": "Adding auth for registry: %s", - "FoundLocalRegistries": "Found %d registries in this account/collection", - "AddingLocalCredentials": "Adding credentials for a local registry", - "AddingEndpointCredentials": "Adding credentials for the %s endpoint", - "AuthenticatingThisNpmrc": "Adding authentication to the .npmrc file at %s", - "IgnoringRegistry": "No service endpoints that matched %s were found", - "ForcePackagingUrl": "Packaging collection url forced to: %s", - "CheckedInCredentialsOverriden": "Found and overrode credentials for the %s registry in the selected .npmrc file. Remove credentials from the file and store them in an npm Service Endpoint instead (recommended), or remove the npm Authenticate step from your build to use credentials checked into an .npmrc.", - "NoIndexJsonFile": "No index.json file was found and no files were restored", - "RevertedChangesToNpmrc" : "Reverted changes made to %s.", - "NpmrcDoesNotExist" : "The .npmrc file you selected at %s does not currently exist." + { + "groupName": "customRegistries", + "name": "customFeed", + "label": "Use packages from this VSTS/TFS registry", + "helpMarkDown": "Include the selected feed in the generated .npmrc.", + "type": "pickList", + "visibleRule": "customRegistry = useFeed", + "required": true + }, + { + "groupName": "customRegistries", + "name": "customEndpoint", + "label": "Credentials for registries outside this account/collection", + "helpMarkDown": "Credentials to use for external registries located in the project's .npmrc. For registries in this account/collection, leave this blank; the build’s credentials are used automatically.", + "type": "connectedService:externalnpmregistry", + "visibleRule": "customRegistry = useNpmrc", + "properties": { + "MultiSelectFlatList": "true" + } + } + ], + "dataSourceBindings": [ + { + "target": "customFeed", + "endpointId": "tfs:feed", + "endpointUrl": "{{endpoint.url}}/_apis/packaging/feeds", + "resultSelector": "jsonpath:$.value[*]", + "resultTemplate": "{ \"Value\": \"{{{id}}}\", \"DisplayValue\": \"{{{name}}}\"}" + } + ], + "execution": { + "Node": { + "target": "yarnTask.js", + "argumentFormat": "" } -} \ No newline at end of file + }, + "messages": { + "FoundBuildCredentials": "Found build credentials", + "NoBuildCredentials": "Could not find build credentials", + "ServiceEndpointNotDefined": "Couldn't find Service Endpoint, make sure the selected endpoint still exists.", + "NpmrcNotNpmrc": "The file you selected to authenticate (%s) is not a valid .npmrc file.", + "ServiceEndpointUrlNotDefined": "Couldn't find Url for Service Endpoint, make sure Service Endpoint is correctly configured.", + "SavingFile": "Saving file %s", + "RestoringFile": "Restoring file %s", + "AddingAuthRegistry": "Adding auth for registry: %s", + "FoundLocalRegistries": "Found %d registries in this account/collection", + "AddingLocalCredentials": "Adding credentials for a local registry", + "AddingEndpointCredentials": "Adding credentials for the %s endpoint", + "AuthenticatingThisNpmrc": "Adding authentication to the .npmrc file at %s", + "IgnoringRegistry": "No service endpoints that matched %s were found", + "ForcePackagingUrl": "Packaging collection url forced to: %s", + "CheckedInCredentialsOverriden": "Found and overrode credentials for the %s registry in the selected .npmrc file. Remove credentials from the file and store them in an npm Service Endpoint instead (recommended), or remove the npm Authenticate step from your build to use credentials checked into an .npmrc.", + "NoIndexJsonFile": "No index.json file was found and no files were restored", + "RevertedChangesToNpmrc": "Reverted changes made to %s.", + "NpmrcDoesNotExist": "The .npmrc file you selected at %s does not currently exist." + } +} diff --git a/Tasks/Yarn/task.loc.json b/Tasks/Yarn/task.loc.json index 2e5acc0..8ade83a 100644 --- a/Tasks/Yarn/task.loc.json +++ b/Tasks/Yarn/task.loc.json @@ -94,13 +94,6 @@ "endpointUrl": "{{endpoint.url}}/_apis/packaging/feeds", "resultSelector": "jsonpath:$.value[*]", "resultTemplate": "{ \"Value\": \"{{{id}}}\", \"DisplayValue\": \"{{{name}}}\"}" - }, - { - "target": "publishFeed", - "endpointId": "tfs:feed", - "endpointUrl": "{{endpoint.url}}/_apis/packaging/feeds", - "resultSelector": "jsonpath:$.value[*]", - "resultTemplate": "{ \"Value\": \"{{{id}}}\", \"DisplayValue\": \"{{{name}}}\"}" } ], "execution": {