Skip to content
Open
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.10.5",
"version": "4.10.6-beta.0",
"description": "A cli tool to manage apps (and monday-code projects) in monday.com",
"author": "monday.com Apps Team",
"type": "module",
Expand Down
7 changes: 6 additions & 1 deletion src/services/__tests__/mondaycoderc-schema.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ describe('mondaycodercSchema Validation', () => {
});

it('should validate a correct Java runtime and version', () => {
const data = { RUNTIME: 'Java', RUNTIME_VERSION: '17' };
const data = { RUNTIME: 'Java', RUNTIME_VERSION: '17.0.1' };
expect(() => mondaycodercSchema.parse(data)).not.toThrow();
});

it('should invalidate a Java version that is just a number', () => {
const data = { RUNTIME: 'Java', RUNTIME_VERSION: '17' };
expect(() => mondaycodercSchema.parse(data)).toThrow('Invalid RUNTIME_VERSION');
});

it('should validate a missing runtime version when runtime is specified', () => {
const data = { RUNTIME: 'Java' };
expect(() => mondaycodercSchema.parse(data)).not.toThrow();
Expand Down
6 changes: 4 additions & 2 deletions src/services/schemas/mondaycoderc-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ export const mondaycodercSchema = z

if (data.RUNTIME === 'Java') {
// 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');
if (!/^(8|11|17|21)\.\d+\.\d+$/.test(data.RUNTIME_VERSION || '')) {
throw new Error(
'Invalid RUNTIME_VERSION for Java in .mondaycoderc. Allowed versions are 8.x.x, 11.x.x, 17.x.x, 21.x.x',
);
}

return true;
Expand Down
Loading