From 60cf13a22b346973a9f3ace17d81a068b6480596 Mon Sep 17 00:00:00 2001 From: Cadence Ember Date: Tue, 2 Jun 2020 02:55:19 +1200 Subject: [PATCH] Properly wait for first compile --- package-lock.json | 16 ++++++++-------- package.json | 2 +- src/site/repl.js | 6 ++---- src/site/server.js | 6 ++++-- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index a671e33..8ae5adb 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2175,9 +2175,9 @@ } }, "mime": { - "version": "2.4.5", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.5.tgz", - "integrity": "sha512-3hQhEUF027BuxZjQA3s7rIv/7VCQPa27hN9u9g87sEkWaKwQPuXOkVKtOeiyUrnWqTDiOs8Ed2rwg733mB0R5w==" + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", + "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==" }, "mime-db": { "version": "1.43.0", @@ -2738,8 +2738,8 @@ "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==" }, "pinski": { - "version": "github:cloudrac3r/pinski#0ac730907da8f3a644bc9d50063b6367b15b7944", - "from": "github:cloudrac3r/pinski#0ac730907da8f3a644bc9d50063b6367b15b7944", + "version": "github:cloudrac3r/pinski#b062547bc0dcebb82c3aa7da36c13988a68b8acc", + "from": "github:cloudrac3r/pinski#b062547bc0dcebb82c3aa7da36c13988a68b8acc", "requires": { "mime": "^2.4.4", "pug": "^2.0.3", @@ -3129,9 +3129,9 @@ "dev": true }, "sass": { - "version": "1.26.5", - "resolved": "https://registry.npmjs.org/sass/-/sass-1.26.5.tgz", - "integrity": "sha512-FG2swzaZUiX53YzZSjSakzvGtlds0lcbF+URuU9mxOv7WBh7NhXEVDa4kPKN4hN6fC2TkOTOKqiqp6d53N9X5Q==", + "version": "1.26.7", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.26.7.tgz", + "integrity": "sha512-xgNazdkr6yvgHEfNaOjKtZzhDZmKYMCmoRKMPrTDo7YvjaITIzU2DDYsIUuN/atAg7/JOxPeCQHH7TtCo5Tq2g==", "requires": { "chokidar": ">=2.0.0 <4.0.0" } diff --git a/package.json b/package.json index ac6a0ea..846238f 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "mixin-deep": "^2.0.1", "node-dir": "^0.1.17", "node-fetch": "^2.6.0", - "pinski": "github:cloudrac3r/pinski#0ac730907da8f3a644bc9d50063b6367b15b7944", + "pinski": "github:cloudrac3r/pinski#b062547bc0dcebb82c3aa7da36c13988a68b8acc", "pug": "^2.0.4", "semver": "^7.2.1", "sharp": "^0.25.2", diff --git a/src/site/repl.js b/src/site/repl.js index eebf6b1..627d045 100644 --- a/src/site/repl.js +++ b/src/site/repl.js @@ -29,7 +29,5 @@ function customWriter(output) { return output } -setTimeout(() => { - console.log("[.] REPL started") - repl.start({prompt: "b) ", eval: customEval, writer: customWriter}).once("exit", () => process.exit()) -}, 2000) // wait for pinski to initialise. TODO: do this properly +console.log("[.] REPL started") +repl.start({prompt: "b) ", eval: customEval, writer: customWriter}).once("exit", () => process.exit()) diff --git a/src/site/server.js b/src/site/server.js index a5b7849..a74b019 100644 --- a/src/site/server.js +++ b/src/site/server.js @@ -55,7 +55,7 @@ subdirs("pug", async (err, dirs) => { pinski.addAPIDir("api") if (constants.as_assistant.enabled) { - console.log("Assistant API enabled") + console.log("[.] Assistant API enabled") pinski.addAPIDir("assistant_api") } @@ -68,6 +68,8 @@ subdirs("pug", async (err, dirs) => { console.log("[.] Server started") if (process.stdin.isTTY || process.argv.includes("--enable-repl")) { - require("./repl") + pinski.waitForFirstCompile().then(() => { + require("./repl") + }) } })