Skip to content

Commit

Permalink
up to date supported runtime versions for existing runtimes (#105)
Browse files Browse the repository at this point in the history
* up to date supported runtime versions for existing runtimes

* bump package version

* up to date supported runtime versions for existing runtimes
  • Loading branch information
gregra81 authored Oct 30, 2024
1 parent b8652e3 commit 89f4405
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
26 changes: 16 additions & 10 deletions src/services/schemas/mondaycoderc-schema.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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;
Expand All @@ -42,34 +44,38 @@ 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',
);
}

return true;
}

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;
Expand Down

0 comments on commit 89f4405

Please sign in to comment.