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

Update dependencies to latest - Fix getIterator error #2

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
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
16 changes: 10 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
//vscode import settings for default formatter (typescript && js)

// using official denoland extension
{
"deno.enable": true,
"deno.lint": true,
"deno.unstable": true,
"[typescript]": {
"editor.defaultFormatter": "denoland.vscode-deno"
"deno.unstable": false,
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true
},
"[javascript]": {
"editor.defaultFormatter": "denoland.vscode-deno"
"editor.defaultFormatter": "denoland.vscode-deno",
"editor.formatOnSave": true,
"editor.formatOnPaste": false,
"deno.suggest.imports.hosts": {
"https://deno.land": true
}
}
12 changes: 4 additions & 8 deletions core/cli/dev.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
import { Application, path, send } from "../utils/deps.ts";
import { WebSocketClient, WebSocketServer } from "../utils/deps.ts";
import * as print from "./stdout.ts";
import { exec } from "../utils/deps.ts";
import { watchAndRebuild } from "./liveRebuild.ts";
import { event } from "../utils/events.ts"


import { event } from "../utils/events.ts";

export const server: Application = new Application();

export const runDevServer = async function (port: number, hostname: string) {
const wss = new WebSocketServer(8080);
wss.on("connection", function (ws: WebSocketClient) {
ws.send('[LiveReload is watching...');
ws.send("[LiveReload is watching...");
// create event listener that listens for "buildDone" event
const reloadWindow = () => {
console.log("[back to you Client!]");
ws.send('reload window');
ws.send("reload window");
event.removeListener("buildDone", reloadWindow);
};

Expand All @@ -27,7 +24,6 @@ export const runDevServer = async function (port: number, hostname: string) {
});
});


//server route handler
server.use(async (ctx, next) => {
const { pathname } = ctx.request.url;
Expand Down Expand Up @@ -60,7 +56,7 @@ export const runDevServer = async function (port: number, hostname: string) {
server.addEventListener("listen", () => {
print.LISTEN(port, hostname);
if (running === false) {
watchAndRebuild({ ssr: false });
watchAndRebuild({ ssr: false });
running = true;
}
});
Expand Down
3 changes: 1 addition & 2 deletions core/dts/factory.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ export interface Config {
* preferred host
* default: "0.0.0.0"
*/

};
}
export declare namespace Vue {
Expand Down Expand Up @@ -231,4 +230,4 @@ export declare namespace Router {
ref: string | boolean,
): Promise<string>;
}
}
}
4 changes: 2 additions & 2 deletions core/factory/Factory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export default class Factory {
const decoder = new TextDecoder("utf-8");

const styles = decoder.decode(
Deno.readFileSync(Deno.cwd()+"/vno-build/style.css"),
Deno.readFileSync(Deno.cwd() + "/vno-build/style.css"),
);

Deno.writeTextFileSync(
Expand Down Expand Up @@ -188,6 +188,6 @@ export default class Factory {
// added router 9/21/21
get router() {
if (this._router) return this._router;
return "^4.0.0-0"
return "^4.0.0-0";
}
}
17 changes: 8 additions & 9 deletions core/lib/resolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@ export const _script: Resolve.Source = async function (data, path, tsCheck) {
if (typeof data === "string") {
throw new TypeError("invalid arguments");
}
//"^" beginning of line
//"\s" looks for whitespace
//looking for export
//"*" 0 or more
//() capture group: please find any in capture group and also allow you to remember it refer
//to it by $1,2,3 etc.. like postgres $1, $2 for points you want to make dynamic.
//so later you can change the $1 that you can find and replace
//"^" beginning of line
//"\s" looks for whitespace
//looking for export
//"*" 0 or more
//() capture group: please find any in capture group and also allow you to remember it refer
//to it by $1,2,3 etc.. like postgres $1, $2 for points you want to make dynamic.
//so later you can change the $1 that you can find and replace
const start = utils.indexOfRegExp(/^\s*(export)/, data);
const end = data.lastIndexOf("}");

const trimmed = data.slice(start + 1, end).join("\n");
//grabed trim a string of key:value pairs and putting it inside object
//grabed trim a string of key:value pairs and putting it inside object
let script = tsCheck
? await typescriptCompile(`({ ${trimmed} })`, path)
: trimmed as string;
Expand Down Expand Up @@ -79,7 +79,6 @@ export const _dependants: Resolve.Attrs = function (curr, arr, storage, queue) {
}
};


//vno struggles with third party imports in component file.
//this collects all potential imports. inserts them at the top of the bundle - not working perfectly
//
Expand Down
8 changes: 4 additions & 4 deletions core/ssg/dev.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {
WebSocketClient,
WebSocketServer,
} from "https://deno.land/x/[email protected].2/mod.ts";
import { Application, send } from "https://deno.land/x/oak@v7.7.0/mod.ts";
import { EventEmitter } from "https://deno.land/std@0.100.0/node/events.ts";
import * as path from "https://deno.land/std@0.99.0/path/mod.ts";
} from "https://deno.land/x/[email protected].3/mod.ts";
import { Application, send } from "https://deno.land/x/oak@v10.0.0/mod.ts";
import { EventEmitter } from "https://deno.land/std@0.117.0/node/events.ts";
import * as path from "https://deno.land/std@0.117.0/path/mod.ts";
import { debounce } from "./utils.ts";
import { generate } from "./generate.ts";

Expand Down
23 changes: 12 additions & 11 deletions core/utils/deps.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// deno std library
export * as fs from "https://deno.land/std@0.83.0/fs/mod.ts";
export * as path from "https://deno.land/std@0.83.0/path/mod.ts";
export * as colors from "https://deno.land/std@0.83.0/fmt/colors.ts";
export * as http from "https://deno.land/std@0.83.0/http/mod.ts";
export { v4 } from "https://deno.land/std@0.88.0/uuid/mod.ts"; //uuid generator
export * as fs from "https://deno.land/std@0.117.0/fs/mod.ts";
export * as path from "https://deno.land/std@0.117.0/path/mod.ts";
export * as colors from "https://deno.land/std@0.117.0/fmt/colors.ts";
export * as http from "https://deno.land/std@0.117.0/http/mod.ts";
export { v4 } from "https://deno.land/std@0.117.0/uuid/mod.ts"; //uuid generator
export {
assertEquals,
assertNotEquals,
} from "https://deno.land/std@0.83.0/testing/asserts.ts"; // testing library
} from "https://deno.land/std@0.117.0/testing/asserts.ts"; // testing library
import {
WebSocketClient,
WebSocketServer,
} from "https://deno.land/x/[email protected].1/mod.ts";
} from "https://deno.land/x/[email protected].3/mod.ts";
export { WebSocketServer };
export type { WebSocketClient };

Expand All @@ -21,11 +21,12 @@ export {
Context,
Router,
send,
} from "https://deno.land/x/oak@v6.5.0/mod.ts";
export { superoak } from "https://deno.land/x/superoak@4.0.0/mod.ts"; // testing lib for oak
} from "https://deno.land/x/oak@v10.0.0/mod.ts";
export { superoak } from "https://deno.land/x/superoak@4.5.0/mod.ts"; // testing lib for oak

// third-party
import _ from "https://cdn.skypack.dev/lodash"; // lodash
import * as _ from "https://deno.land/x/[email protected]/lodash.js"; // lodash

import ProgressBar from "https://deno.land/x/[email protected]/mod.ts";
import { exec } from "https://deno.land/x/exec/mod.ts";
export { _, exec, ProgressBar };
Expand All @@ -35,5 +36,5 @@ export { compile as scssCompiler } from "https://raw.githubusercontent.com/crewd
export * as sfcCompiler from "https://denopkg.com/crewdevio/vue-deno-compiler/mod.ts";

//event emitter for live reload
import { EventEmitter } from "https://deno.land/std@0.93.0/node/events.ts";
import { EventEmitter } from "https://deno.land/std@0.117.0/node/events.ts";
export { EventEmitter };