diff --git a/package.json b/package.json index 09f18cb..251631b 100755 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@mondaycom/apps-cli", - "version": "4.2.0", + "version": "4.3.0", "description": "A cli tool to manage apps (and monday-code projects) in monday.com", "author": "monday.com Apps Team", "type": "module", diff --git a/src/services/schemas/mondaycoderc-schema.ts b/src/services/schemas/mondaycoderc-schema.ts index 49de3b0..2c4e104 100644 --- a/src/services/schemas/mondaycoderc-schema.ts +++ b/src/services/schemas/mondaycoderc-schema.ts @@ -1,5 +1,6 @@ import { z } from 'zod'; +// See here for all the supported versions https://cloud.google.com/docs/buildpacks/builders#buildergoogle-22_supported_languages export const mondaycodercSchema = z .object({ RUNTIME: z @@ -26,8 +27,9 @@ export const mondaycodercSchema = z } if (data.RUNTIME === 'Java') { - if (!['11', '17', '18'].includes(data.RUNTIME_VERSION || '')) { - throw new Error('Invalid RUNTIME_VERSION for Java in .mondaycoderc. Allowed versions are 11, 17, 18'); + // 8, 11, 17, 21 are the only LTS versions, see https://www.oracle.com/eg/java/technologies/java-se-support-roadmap.html + if (!['8', '11', '17', '21'].includes(data.RUNTIME_VERSION || '')) { + throw new Error('Invalid RUNTIME_VERSION for Java in .mondaycoderc. Allowed versions are 8, 11, 17, 21'); } return true; @@ -42,25 +44,28 @@ export const mondaycodercSchema = z } if (data.RUNTIME === 'PHP') { - if (!/^8\.(1|2)\.\d+$/.test(data.RUNTIME_VERSION || '')) { - throw new Error('Invalid RUNTIME_VERSION for PHP in .mondaycoderc. Allowed versions are 8.1.x, 8.2.x'); + if (!/^8\.([1-3])\.\d+$/.test(data.RUNTIME_VERSION || '')) { + throw new Error('Invalid RUNTIME_VERSION for PHP in .mondaycoderc. Allowed versions are 8.1.x, 8.2.x, 8.3.x'); } return true; } if (data.RUNTIME === 'Ruby') { - if (!/^3\.(1|2)\.\d+$/.test(data.RUNTIME_VERSION || '')) { - throw new Error('Invalid RUNTIME_VERSION for Ruby in .mondaycoderc. Allowed versions are 3.1.x, 3.2.x'); + if (!/^3\.([1-3])\.\d+$/.test(data.RUNTIME_VERSION || '')) { + throw new Error( + 'Invalid RUNTIME_VERSION for Ruby in .mondaycoderc. Allowed versions are 3.1.x, 3.2.x and 3.3.x', + ); } return true; } if (data.RUNTIME === 'Node.js') { - if (!/^(12|14|16|18|20)\.\d+\.\d+$/.test(data.RUNTIME_VERSION || '')) { + // See here https://nodejs.org/en/about/previous-releases + if (!/^(18|20|22)\.\d+\.\d+$/.test(data.RUNTIME_VERSION || '')) { throw new Error( - 'Invalid RUNTIME_VERSION for Node.js in .mondaycoderc. Allowed versions are 12.x.x, 14.x.x, 16.x.x, 18.x.x, 20.x.x', + 'Invalid RUNTIME_VERSION for Node.js in .mondaycoderc. Allowed versions are 18.x.x, 20.x.x, 22.x.x', ); } @@ -68,8 +73,9 @@ export const mondaycodercSchema = z } if (data.RUNTIME === 'NETCore') { - if (!/^(6|7)\.\d+$/.test(data.RUNTIME_VERSION || '')) { - throw new Error('Invalid RUNTIME_VERSION for NETCore in .mondaycoderc. Allowed versions are 6.x, 7.x'); + // See here https://dotnet.microsoft.com/en-us/download/dotnet + if (!/^(6|8)\.\d+$/.test(data.RUNTIME_VERSION || '')) { + throw new Error('Invalid RUNTIME_VERSION for NETCore in .mondaycoderc. Allowed versions are 6.x, 8.x'); } return true;