From dfc53df6d548a0233f7d357b309a66c65140ceef Mon Sep 17 00:00:00 2001 From: Mantra Date: Sat, 16 Nov 2024 09:54:28 +0000 Subject: [PATCH 1/2] fix rest of tests --- app/server/tests/apiService.test.ts | 14 ++++---- app/server/tests/appFileReader.test.ts | 12 +++---- app/server/tests/configReader.test.ts | 10 +++--- app/server/tests/handleError.test.ts | 19 +++++----- .../tests/integration/integrationTest.ts | 2 +- app/server/tests/jsonResponse.test.ts | 8 ++--- app/server/tests/logging.test.ts | 18 ++++++---- app/server/tests/redis.test.ts | 36 +++++++++---------- app/server/tests/routes/apps.test.ts | 31 ++++++++-------- app/server/tests/routes/config.test.ts | 24 ++++++------- app/server/tests/routes/index.test.ts | 34 +++++++++--------- app/server/tests/routes/odin.test.ts | 30 ++++++++-------- app/server/tests/server/views.test.ts | 29 ++++----------- 13 files changed, 124 insertions(+), 143 deletions(-) diff --git a/app/server/tests/apiService.test.ts b/app/server/tests/apiService.test.ts index ed18a23f6..73131287e 100644 --- a/app/server/tests/apiService.test.ts +++ b/app/server/tests/apiService.test.ts @@ -5,7 +5,7 @@ import { api } from "../src/apiService"; describe("apiService", () => { beforeEach(() => { mockAxios.reset(); - jest.resetAllMocks(); + vi.resetAllMocks(); }); const mockReq = { @@ -23,9 +23,9 @@ describe("apiService", () => { } as any; const mockRes = { - status: jest.fn(), - header: jest.fn(), - end: jest.fn() + status: vi.fn(), + header: vi.fn(), + end: vi.fn() } as any; const postData = "posted data"; @@ -33,7 +33,7 @@ describe("apiService", () => { const responseData = { data: "test get" }; const responseHeaders = { respHeader1: "rh1", respHeader2: "rh2" }; - const mockNext = jest.fn(); + const mockNext = vi.fn(); const testExpectedResponse = () => { expect(mockRes.status.mock.calls[0][0]).toBe(200); @@ -50,13 +50,13 @@ describe("apiService", () => { headers: AxiosRequestHeaders, transformResponse: AxiosResponseTransformer ) => { - expect(headers).toStrictEqual({ + expect(headers.toJSON()).toEqual({ Accept: "application/json", "Content-Type": "text", ArrayHeader: "arr1,arr2" }); const transformTest = "{\"json\": \"test\"}"; - expect((transformResponse as AxiosResponseTransformer)(transformTest)).toBe(transformTest); + expect((transformResponse as any)(transformTest)).toBe(transformTest); }; const testExpectedError = () => { diff --git a/app/server/tests/appFileReader.test.ts b/app/server/tests/appFileReader.test.ts index 7fa194ac6..f88626881 100644 --- a/app/server/tests/appFileReader.test.ts +++ b/app/server/tests/appFileReader.test.ts @@ -1,14 +1,14 @@ -import * as fs from "fs"; +import fs from "fs"; import { AppFileReader } from "../src/appFileReader"; describe("DefaultCodeReader", () => { afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); it("returns lines from file when file exists", () => { - const mockExistsSync = jest.spyOn(fs, "existsSync").mockReturnValue(true); - const mockReadFileSync = jest.spyOn(fs, "readFileSync").mockReturnValue("line1\nline2\nline3"); + const mockExistsSync = vi.spyOn(fs, "existsSync").mockReturnValue(true); + const mockReadFileSync = vi.spyOn(fs, "readFileSync").mockReturnValue("line1\nline2\nline3"); const result = new AppFileReader("/testDir", "R").readFile("TestApp"); expect(result).toStrictEqual(["line1", "line2", "line3"]); @@ -18,8 +18,8 @@ describe("DefaultCodeReader", () => { }); it("returns empty string array when file does not exist", () => { - const mockExistsSync = jest.spyOn(fs, "existsSync").mockReturnValue(false); - const mockReadFileSync = jest.spyOn(fs, "readFileSync"); + const mockExistsSync = vi.spyOn(fs, "existsSync").mockReturnValue(false); + const mockReadFileSync = vi.spyOn(fs, "readFileSync"); const result = new AppFileReader("/testDir", "R").readFile("TestApp"); expect(result).toStrictEqual([]); diff --git a/app/server/tests/configReader.test.ts b/app/server/tests/configReader.test.ts index b31a771d9..e2f7f4137 100644 --- a/app/server/tests/configReader.test.ts +++ b/app/server/tests/configReader.test.ts @@ -1,13 +1,13 @@ -import * as fs from "fs"; +import fs from "fs"; import { ConfigReader } from "../src/configReader"; describe("configReader", () => { beforeEach(() => { - jest.restoreAllMocks(); + vi.restoreAllMocks(); }); it("returns null when config not found", () => { - const mockExistsSync = jest.spyOn(fs, "existsSync").mockReturnValue(false); + const mockExistsSync = vi.spyOn(fs, "existsSync").mockReturnValue(false); const result = new ConfigReader("root").readConfigFile("test.config"); @@ -17,8 +17,8 @@ describe("configReader", () => { }); it("returns parsed config file contents", () => { - const mockExistsSync = jest.spyOn(fs, "existsSync").mockReturnValue(true); - const mockReadFileSync = jest.spyOn(fs, "readFileSync").mockReturnValue("{\"test\": \"value\"}"); + const mockExistsSync = vi.spyOn(fs, "existsSync").mockReturnValue(true); + const mockReadFileSync = vi.spyOn(fs, "readFileSync").mockReturnValue("{\"test\": \"value\"}"); const result = new ConfigReader("root").readConfigFile("test.config"); diff --git a/app/server/tests/handleError.test.ts b/app/server/tests/handleError.test.ts index 8dec48c31..b004a95e6 100644 --- a/app/server/tests/handleError.test.ts +++ b/app/server/tests/handleError.test.ts @@ -1,7 +1,6 @@ -/* eslint-disable import/first */ // mock json response before import errors -const mockJsonResponseError = jest.fn(); -jest.mock("../src/jsonResponse", () => { return { jsonResponseError: mockJsonResponseError }; }); +const { mockJsonResponseError } = vi.hoisted(() => ({ mockJsonResponseError: vi.fn() })); +vi.mock("../src/jsonResponse", () => { return { jsonResponseError: mockJsonResponseError }; }); import { handleError } from "../src/errors/handleError"; import { WodinError } from "../src/errors/wodinError"; @@ -17,18 +16,18 @@ const mockRequest = (accept = "application/json,*/*") => { }; const mockStatus = { - render: jest.fn() + render: vi.fn() }; const mockResponse = () => { return { - status: jest.fn().mockReturnValue(mockStatus) + status: vi.fn().mockReturnValue(mockStatus) } as any; }; describe("handeError", () => { afterEach(() => { - jest.resetAllMocks(); + vi.resetAllMocks(); }); const testUnexpectedErrorMsg = (msg: string) => { @@ -42,7 +41,7 @@ describe("handeError", () => { const err = new WodinError("test wodin error", 404, ErrorType.NOT_FOUND); const req = mockRequest(); const res = mockResponse(); - handleError(err, req, res, jest.fn()); + handleError(err, req, res, vi.fn()); // check expected data has been attached to request expect(req.errorType).toBe(ErrorType.NOT_FOUND); @@ -61,7 +60,7 @@ describe("handeError", () => { const err = new Error("something bad"); const req = mockRequest(); const res = mockResponse(); - handleError(err, req, res, jest.fn()); + handleError(err, req, res, vi.fn()); // check expected data has been attached to request expect(req.errorType).toBe(ErrorType.OTHER_ERROR); @@ -81,7 +80,7 @@ describe("handeError", () => { const err = new WodinWebError("test wodin web error", 404, ErrorType.NOT_FOUND, "test-view", options); const req = mockRequest("text/html"); const res = mockResponse(); - handleError(err, req, res, jest.fn()); + handleError(err, req, res, vi.fn()); // check expected data has been attached to request expect(req.errorType).toBe(ErrorType.NOT_FOUND); @@ -98,7 +97,7 @@ describe("handeError", () => { const err = new Error("something bad"); const req = mockRequest("text/html"); const res = mockResponse(); - handleError(err, req, res, jest.fn()); + handleError(err, req, res, vi.fn()); // check expected data has been attached to request expect(req.errorType).toBe(ErrorType.OTHER_ERROR); diff --git a/app/server/tests/integration/integrationTest.ts b/app/server/tests/integration/integrationTest.ts index 1f60ebf12..a1252d75d 100644 --- a/app/server/tests/integration/integrationTest.ts +++ b/app/server/tests/integration/integrationTest.ts @@ -1,3 +1,3 @@ -const request = require("supertest"); +import request from "supertest"; export const wodin = request("http://localhost:3000"); diff --git a/app/server/tests/jsonResponse.test.ts b/app/server/tests/jsonResponse.test.ts index c61ab72f2..bb9de5c5a 100644 --- a/app/server/tests/jsonResponse.test.ts +++ b/app/server/tests/jsonResponse.test.ts @@ -1,9 +1,9 @@ import { jsonResponseError, jsonResponseSuccess } from "../src/jsonResponse"; describe("jsonResponse", () => { - const mockHeader = jest.fn(); - const mockStatus = jest.fn(); - const mockEnd = jest.fn(); + const mockHeader = vi.fn(); + const mockStatus = vi.fn(); + const mockEnd = vi.fn(); const mockRes = { header: mockHeader, status: mockStatus, @@ -11,7 +11,7 @@ describe("jsonResponse", () => { }; beforeEach(() => { - jest.resetAllMocks(); + vi.resetAllMocks(); }); it("jsonResponseSuccess adds header and expected response text", () => { diff --git a/app/server/tests/logging.test.ts b/app/server/tests/logging.test.ts index 034a2a9b0..76152dfd7 100644 --- a/app/server/tests/logging.test.ts +++ b/app/server/tests/logging.test.ts @@ -1,16 +1,20 @@ // mock morgan before import logging -const mockMorganResult = {}; -const mockMorgan = jest.fn().mockReturnValue(mockMorganResult); -const mockMorganToken = jest.fn(); +const { mockMorgan, mockMorganToken, mockMorganResult } = vi.hoisted(() => { + const mockMorganResult = {}; + return { + mockMorganResult, + mockMorgan: vi.fn().mockReturnValue({}), + mockMorganToken: vi.fn() + } +}); (mockMorgan as any).token = mockMorganToken; -jest.mock("morgan", () => mockMorgan); +vi.mock("morgan", () => ({default: mockMorgan})); -// eslint-disable-next-line import/first import { initialiseLogging } from "../src/logging"; describe("logging", () => { it("initialiseLogging registers custom tokens and format", () => { - const mockApplication = { use: jest.fn() } as any; + const mockApplication = { use: vi.fn() } as any; initialiseLogging(mockApplication); // Test custom tokens have been registered @@ -32,7 +36,7 @@ describe("logging", () => { expect(errorStackFn(testRequest)).toBe("TEST ERROR STACK"); // Test expected custom format has been registered - expect(mockApplication.use.mock.calls[0][0]).toBe(mockMorganResult); + expect(mockApplication.use.mock.calls[0][0]).toStrictEqual(mockMorganResult); const customFormatFn = mockMorgan.mock.calls[0][0]; const testReq = { diff --git a/app/server/tests/redis.test.ts b/app/server/tests/redis.test.ts index e903ac76a..26f4214c8 100644 --- a/app/server/tests/redis.test.ts +++ b/app/server/tests/redis.test.ts @@ -1,7 +1,7 @@ import { redisConnection } from "../src/redis"; describe("redis", () => { - const mockConsoleLog = jest.fn(); + const mockConsoleLog = vi.fn(); const realConsoleLog = console.log; const realArgs = process.argv; @@ -15,30 +15,26 @@ describe("redis", () => { }); afterEach(() => { - jest.clearAllMocks(); + vi.clearAllMocks(); }); - it("can connect", (done) => { - const errorCallback = jest.fn(); + it("can connect", async () => { + const errorCallback = vi.fn(); const redis = redisConnection("redis://localhost:6379", errorCallback); - setTimeout(() => { - redis.disconnect(); - expect(mockConsoleLog).toBeCalledTimes(1); - expect(mockConsoleLog.mock.calls[0][0]) - .toBe("Connected to Redis server redis://localhost:6379"); - expect(errorCallback).not.toHaveBeenCalled(); - done(); - }, 200); + await new Promise(res => setTimeout(res, 200)); + redis.disconnect(); + expect(mockConsoleLog).toBeCalledTimes(1); + expect(mockConsoleLog.mock.calls[0][0]) + .toBe("Connected to Redis server redis://localhost:6379"); + expect(errorCallback).not.toHaveBeenCalled(); }); - it("calls error callback if cannot connect", (done) => { - const errorCallback = jest.fn(); + it("calls error callback if cannot connect", async () => { + const errorCallback = vi.fn(); redisConnection("redis://localhost:1234", errorCallback); - setTimeout(() => { - expect(mockConsoleLog.mock.calls[0][0].message) - .toContain("connect ECONNREFUSED 127.0.0.1:1234"); - expect(errorCallback).toHaveBeenCalled(); - done(); - }, 200); + await new Promise(res => setTimeout(res, 200)); + expect(mockConsoleLog.mock.calls[0][0].message) + .toContain("connect ECONNREFUSED 127.0.0.1:1234"); + expect(errorCallback).toHaveBeenCalled(); }); }); diff --git a/app/server/tests/routes/apps.test.ts b/app/server/tests/routes/apps.test.ts index ee66de6b5..32ab83183 100644 --- a/app/server/tests/routes/apps.test.ts +++ b/app/server/tests/routes/apps.test.ts @@ -1,27 +1,26 @@ import { AppsController } from "../../src/controllers/appsController"; import { SessionsController } from "../../src/controllers/sessionsController"; +import bodyParser from "body-parser"; -describe("odin routes", () => { - const express = require("express"); - const bodyParser = require("body-parser"); +const { mockRouter } = vi.hoisted(() => ({ + mockRouter: { + get: vi.fn(), + post: vi.fn() + } +})); - const mockRouter = { - get: jest.fn(), - post: jest.fn() - }; - const realRouter = express.Router; +vi.mock("express", () => ({ + Router: () => mockRouter +})); - const spyText = jest.spyOn(bodyParser, "text"); - - beforeAll(() => { - express.Router = () => mockRouter; +describe("odin routes", async () => { + beforeEach(() => { + vi.resetAllMocks() }); - afterAll(() => { - express.Router = realRouter; - }); + const spyText = vi.spyOn(bodyParser, "text"); - it.only("registers expected routes", async () => { + it("registers expected routes", async () => { await import("../../src/routes/apps"); expect(mockRouter.get).toBeCalledTimes(3); diff --git a/app/server/tests/routes/config.test.ts b/app/server/tests/routes/config.test.ts index aebd88e85..0ef352dcd 100644 --- a/app/server/tests/routes/config.test.ts +++ b/app/server/tests/routes/config.test.ts @@ -1,19 +1,19 @@ import { ConfigController } from "../../src/controllers/configController"; -describe("config routes", () => { - const express = require("express"); - - const mockRouter = { - get: jest.fn() - }; - const realRouter = express.Router; +const { mockRouter } = vi.hoisted(() => ({ + mockRouter: { + get: vi.fn(), + post: vi.fn() + } +})); - beforeAll(() => { - express.Router = () => mockRouter; - }); +vi.mock("express", () => ({ + Router: () => mockRouter +})); - afterAll(() => { - express.Router = realRouter; +describe("config routes", () => { + beforeEach(() => { + vi.resetAllMocks() }); it("registers expected routes", async () => { diff --git a/app/server/tests/routes/index.test.ts b/app/server/tests/routes/index.test.ts index 164322cf2..7f282a1ad 100644 --- a/app/server/tests/routes/index.test.ts +++ b/app/server/tests/routes/index.test.ts @@ -6,21 +6,21 @@ import appsRoutes from "../../src/routes/apps"; import { ErrorType } from "../../src/errors/errorType"; import { WodinWebError } from "../../src/errors/wodinWebError"; -describe("registerRoutes", () => { - const express = require("express"); - - const mockRouter = { - get: jest.fn(), - use: jest.fn() - }; - const realRouter = express.Router; +const { mockRouter } = vi.hoisted(() => ({ + mockRouter: { + get: vi.fn(), + use: vi.fn(), + post: vi.fn() + } +})); - beforeAll(() => { - express.Router = () => mockRouter; - }); +vi.mock("express", () => ({ + Router: () => mockRouter +})); - afterAll(() => { - express.Router = realRouter; +describe("registerRoutes", () => { + beforeEach(() => { + vi.resetAllMocks() }); const mockApp = { @@ -30,7 +30,7 @@ describe("registerRoutes", () => { } as any; it("registers all expected routes", () => { - const router = registerRoutes(mockApp); + const router = registerRoutes(mockApp) as unknown as typeof mockRouter; expect(router).toBe(mockRouter); expect(router.get).toBeCalledTimes(1); @@ -47,15 +47,15 @@ describe("registerRoutes", () => { }); it("not found handler throws expected error", () => { - const router = registerRoutes(mockApp); + const router = registerRoutes(mockApp) as unknown as typeof mockRouter; const notFoundHandler = router.use.mock.calls[3][0]; const mockReq = { url: "/nonexistent" }; - const mockRender = jest.fn(); - const mockStatus = jest.fn().mockReturnValue({ render: mockRender }); + const mockRender = vi.fn(); + const mockStatus = vi.fn().mockReturnValue({ render: mockRender }); const mockRes = { status: mockStatus }; diff --git a/app/server/tests/routes/odin.test.ts b/app/server/tests/routes/odin.test.ts index 79cb4a155..eecac798d 100644 --- a/app/server/tests/routes/odin.test.ts +++ b/app/server/tests/routes/odin.test.ts @@ -1,25 +1,23 @@ import { OdinController } from "../../src/controllers/odinController"; +import bodyParser from "body-parser"; -describe("odin routes", () => { - const express = require("express"); - const bodyParser = require("body-parser"); - - const mockRouter = { - get: jest.fn(), - post: jest.fn() - }; - const realRouter = express.Router; +const { mockRouter } = vi.hoisted(() => ({ + mockRouter: { + get: vi.fn(), + post: vi.fn() + } +})); - const spyJson = jest.spyOn(bodyParser, "json"); +vi.mock("express", () => ({ + Router: () => mockRouter +})); - beforeAll(() => { - express.Router = () => mockRouter; +describe("odin routes", () => { + beforeEach(() => { + vi.resetAllMocks() }); - afterAll(() => { - express.Router = realRouter; - jest.clearAllMocks(); - }); + const spyJson = vi.spyOn(bodyParser, "json"); it("registers expected routes", async () => { await import("../../src/routes/odin"); diff --git a/app/server/tests/server/views.test.ts b/app/server/tests/server/views.test.ts index 3bd3b9e58..0a44aae54 100644 --- a/app/server/tests/server/views.test.ts +++ b/app/server/tests/server/views.test.ts @@ -1,35 +1,20 @@ import { registerViews } from "../../src/server/views"; -const hbs = require("hbs"); - describe("views", () => { - const realRegHelper = hbs.registerHelper; - const mockRegHelper = jest.fn(); - - beforeAll(() => { - hbs.registerHelper = mockRegHelper; - }); - - afterAll(() => { - hbs.registerHelper = realRegHelper; - }); - it("register views sets app values and registers helper", () => { const mockApp = { - set: jest.fn() + set: vi.fn(), + engine: vi.fn() } as any; registerViews(mockApp, "/testRoot"); + + expect(mockApp.engine).toBeCalledTimes(1); + expect(mockApp.engine.mock.calls[0][0]).toBe("mustache"); + expect(mockApp.set).toBeCalledTimes(2); expect(mockApp.set.mock.calls[0][0]).toBe("view engine"); - expect(mockApp.set.mock.calls[0][1]).toBe("hbs"); + expect(mockApp.set.mock.calls[0][1]).toBe("mustache"); expect(mockApp.set.mock.calls[1][0]).toBe("views"); expect(mockApp.set.mock.calls[1][1]).toBe("/testRoot/views"); - - expect(mockRegHelper).toBeCalledTimes(1); - expect(mockRegHelper.mock.calls[0][0]).toBe("json"); - const jsonHelper = mockRegHelper.mock.calls[0][1]; - - // json helper should jsonify input - expect(jsonHelper({ context: "test" })).toBe("{\"context\":\"test\"}"); }); }); From cff174ffa621aa631195ae2e0c4528dea6f9e847 Mon Sep 17 00:00:00 2001 From: Mantra Date: Sat, 16 Nov 2024 10:05:41 +0000 Subject: [PATCH 2/2] update wodin versions --- app/server/package-lock.json | 127 ++++++++++++++++++++++++++++++++++- app/server/package.json | 3 +- app/server/src/version.ts | 2 +- app/static/package.json | 2 +- 4 files changed, 129 insertions(+), 5 deletions(-) diff --git a/app/server/package-lock.json b/app/server/package-lock.json index 14c89c707..cfaf8646d 100644 --- a/app/server/package-lock.json +++ b/app/server/package-lock.json @@ -1,12 +1,12 @@ { "name": "wodin", - "version": "0.0.0", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "wodin", - "version": "0.0.0", + "version": "1.0.0", "dependencies": { "axios": "^1.7.7", "compression": "^1.7.5", @@ -33,6 +33,7 @@ "@vitest/coverage-istanbul": "^2.1.4", "axios-mock-adapter": "^2.1.0", "eslint": "^9.14.0", + "genversion": "^3.2.0", "nodemon": "^3.1.7", "supertest": "^7.0.0", "ts-node": "^10.9.2", @@ -2083,6 +2084,12 @@ "node": ">=12" } }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true + }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -2437,6 +2444,15 @@ "node": ">= 0.8" } }, + "node_modules/commander": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-7.2.0.tgz", + "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", + "dev": true, + "engines": { + "node": ">= 10" + } + }, "node_modules/component-emitter": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", @@ -2669,6 +2685,21 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, + "node_modules/ejs": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "dev": true, + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/electron-to-chromium": { "version": "1.5.55", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.55.tgz", @@ -3079,6 +3110,36 @@ "node": ">=16.0.0" } }, + "node_modules/filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "dev": true, + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/fill-range": { "version": "7.1.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", @@ -3108,6 +3169,15 @@ "node": ">= 0.8" } }, + "node_modules/find-package": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-package/-/find-package-1.0.0.tgz", + "integrity": "sha512-yVn71XCCaNgxz58ERTl8nA/8YYtIQDY9mHSrgFBfiFtdNNfY0h183Vh8BRkKxD8x9TUw3ec290uJKhDVxqGZBw==", + "dev": true, + "dependencies": { + "parents": "^1.0.1" + } + }, "node_modules/find-up": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", @@ -3251,6 +3321,23 @@ "node": ">=6.9.0" } }, + "node_modules/genversion": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/genversion/-/genversion-3.2.0.tgz", + "integrity": "sha512-OIYSX6XYA8PHecLDCTri30hadSZfAjZ8Iq1+BBDXqLWP4dRLuJNLoNjsSWtTpw97IccK2LDWzkEstxAB8GdN7g==", + "dev": true, + "dependencies": { + "commander": "^7.2.0", + "ejs": "^3.1.9", + "find-package": "^1.0.0" + }, + "bin": { + "genversion": "bin/genversion.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/get-intrinsic": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", @@ -3742,6 +3829,24 @@ "@pkgjs/parseargs": "^0.11.0" } }, + "node_modules/jake": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.2.tgz", + "integrity": "sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==", + "dev": true, + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.4", + "minimatch": "^3.1.2" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -4256,6 +4361,15 @@ "node": ">=6" } }, + "node_modules/parents": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parents/-/parents-1.0.1.tgz", + "integrity": "sha512-mXKF3xkoUt5td2DoxpLmtOmZvko9VfFpwRwkKDHSNvgmpLAeBo18YDhcPbBzJq+QLCHMbGOfzia2cX4U+0v9Mg==", + "dev": true, + "dependencies": { + "path-platform": "~0.11.15" + } + }, "node_modules/parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", @@ -4282,6 +4396,15 @@ "node": ">=8" } }, + "node_modules/path-platform": { + "version": "0.11.15", + "resolved": "https://registry.npmjs.org/path-platform/-/path-platform-0.11.15.tgz", + "integrity": "sha512-Y30dB6rab1A/nfEKsZxmr01nUotHX0c/ZiIAsCTatEe1CmS5Pm5He7fZ195bPT7RdquoaL8lLxFCMQi/bS7IJg==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/path-scurry": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", diff --git a/app/server/package.json b/app/server/package.json index 96bb5d040..728fce763 100644 --- a/app/server/package.json +++ b/app/server/package.json @@ -1,7 +1,7 @@ { "name": "wodin", "private": true, - "version": "0.0.0", + "version": "1.0.0", "scripts": { "build": "tsc --project tsconfig.node.json", "serve": "node dist/server/server.js ../../config", @@ -28,6 +28,7 @@ "@vitest/coverage-istanbul": "^2.1.4", "axios-mock-adapter": "^2.1.0", "eslint": "^9.14.0", + "genversion": "^3.2.0", "nodemon": "^3.1.7", "supertest": "^7.0.0", "ts-node": "^10.9.2", diff --git a/app/server/src/version.ts b/app/server/src/version.ts index d3eb62fa3..4c5cb31a6 100644 --- a/app/server/src/version.ts +++ b/app/server/src/version.ts @@ -1,2 +1,2 @@ // Generated by genversion. -export const version = "0.3.0"; +export const version = "1.0.0"; diff --git a/app/static/package.json b/app/static/package.json index d444e3f3a..eaee07448 100644 --- a/app/static/package.json +++ b/app/static/package.json @@ -1,6 +1,6 @@ { "name": "wodin", - "version": "0.0.0", + "version": "1.0.0", "private": true, "type": "module", "scripts": {