Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

up to date supported runtime versions for existing runtimes #105

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading