Skip to content

Commit

Permalink
V 1.0.2
Browse files Browse the repository at this point in the history
Fix: ctx.request.body.json();
  • Loading branch information
fakoua committed Feb 4, 2024
1 parent 4ae5120 commit e1bbbdb
Show file tree
Hide file tree
Showing 7 changed files with 6,673 additions and 6,675 deletions.
8 changes: 4 additions & 4 deletions build-tools/binToTs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ export async function initServer(wwwRoot: string): Promise<boolean> {
const isExist = await exists(indexFile);
if (isExist) {
//Check for update
const installedVersion = await getUiVersion(indexFile)
const installedVersion = await getUiVersion(indexFile);

if (installedVersion === version) {
return true;
}

console.log(`Updating UI from V${installedVersion} to V${version}`)
console.log(`Updating UI from V${installedVersion} to V${version}`);
//We need to remove old version
await Deno.remove(indexFile);
await Deno.remove(join(wwwRoot, "favicon.ico"));
Expand Down Expand Up @@ -66,7 +66,7 @@ export async function zipToTs(path: string, fileName: string) {

const binPath = join(path, `${fileName}.zip`);
const uint = await Deno.readFile(binPath);

let binary = "";
const len = uint.length;

Expand Down
2 changes: 1 addition & 1 deletion deno.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"tasks": {
"start": "deno run -A mod.ts",
"build": "deno run -A prepare-spa.ts"
"build": "deno fmt && deno lint && deno run -A prepare-spa.ts"
},

"lint": {
Expand Down
5 changes: 2 additions & 3 deletions mod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,8 @@ router.post("/api/service", async (ctx) => {
port: Number(ctx.request.url.searchParams.get("port")!),
};

const req = ctx.request.body({ type: "json" });
const reqObj = await req.value;
const service = await actions(reqObj.serviceName, reqObj.action, payload);
const req = await ctx.request.body.json();
const service = await actions(req.serviceName, req.action, payload);

if (service !== undefined) {
//Change the cache
Expand Down
9 changes: 4 additions & 5 deletions prepare-spa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ await increaseUiVersion();
buildQuasar();
await spaToTypeScript();


function buildQuasar() {
const msg = "Please go to [./q-manui] and build the project [quasar build]."
const msg = "Please go to [./q-manui] and build the project [quasar build].";
alert(msg);
}

Expand All @@ -17,12 +16,12 @@ async function increaseUiVersion() {
const packageFile = "./q-manui/package.json";
let packageJson = await Deno.readTextFile(packageFile);
const pkg = JSON.parse(packageJson);
pkg.version = newVersion;
pkg.description = `DenoMan ${newVersion}`
pkg.version = newVersion;
pkg.description = `DenoMan ${newVersion}`;
packageJson = JSON.stringify(pkg, null, 2);

await Deno.writeTextFile(packageFile, packageJson);
console.log("package.json file updated.")
console.log("package.json file updated.");
}

async function spaToTypeScript() {
Expand Down
4 changes: 2 additions & 2 deletions q-manui/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "q-manui",
"version": "1.0.1",
"description": "DenoMan 1.0.1",
"version": "1.0.2",
"description": "DenoMan 1.0.2",
"productName": "q-manui",
"author": "Sameh Fakoua <s.fakoua@gmail.com>",
"private": true,
Expand Down
2 changes: 1 addition & 1 deletion q-manui/src/layouts/MainLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<q-layout view="lHh Lpr lFf">
<q-header elevated>
<q-toolbar>
<q-toolbar-title> dennoman </q-toolbar-title>
<q-toolbar-title> DenoMan </q-toolbar-title>

<div>v 0.1</div>
</q-toolbar>
Expand Down
13,318 changes: 6,659 additions & 6,659 deletions wwwzip/ui.ts

Large diffs are not rendered by default.

0 comments on commit e1bbbdb

Please sign in to comment.