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

chore: Use node: protocol in imports #168

Open
wants to merge 1 commit 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
4 changes: 2 additions & 2 deletions src/ast.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import path from "path";
import os from "os";
import path from "node:path";
import os from "node:os";
import { DepGraph } from "dependency-graph";

import { WebC } from "../webc.js";
Expand Down
4 changes: 2 additions & 2 deletions src/componentManager.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createHash } from "crypto";
import { createHash } from "node:crypto";

import { WebC } from "../webc.js";
import { AstQuery } from "./astQuery.js";
Expand Down Expand Up @@ -252,4 +252,4 @@ class ComponentManager {
}
}

export { ComponentManager };
export { ComponentManager };
4 changes: 2 additions & 2 deletions src/fasterVmContext.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const vm = require("vm");
const vm = require("node:vm");

class ContextInstance {
constructor() {
Expand Down Expand Up @@ -74,4 +74,4 @@ class FasterVmContext {
}
}

module.exports = { FasterVmContext };
module.exports = { FasterVmContext };
4 changes: 2 additions & 2 deletions src/fsCache.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fs from "fs";
import path from "path";
import fs from "node:fs";
import path from "node:path";

class FileSystemCache {
constructor() {
Expand Down
2 changes: 1 addition & 1 deletion src/moduleResolution.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TemplatePath } from "@11ty/eleventy-utils";
import path from "path";
import path from "node:path";
import { Path } from "./path.js";

class ModuleResolution {
Expand Down
4 changes: 2 additions & 2 deletions src/moduleScript.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const { Module } = require("module");
const vm = require("vm");
const { Module } = require("node:module");
const vm = require("node:vm");
const { RetrieveGlobals } = require("node-retrieve-globals");

const { ProxyData } = require("./proxyData.cjs");
Expand Down
4 changes: 2 additions & 2 deletions src/path.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import path from "path";
import path from "node:path";
import { TemplatePath } from "@11ty/eleventy-utils";

class Path {
Expand All @@ -11,4 +11,4 @@ class Path {
}
}

export { Path };
export { Path };
4 changes: 2 additions & 2 deletions src/streams.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Stream from "stream";
import Stream from "node:stream";

class Streams {
constructor(buckets = []) {
Expand Down Expand Up @@ -55,4 +55,4 @@ class Streams {
}
}

export { Streams };
export { Streams };
4 changes: 2 additions & 2 deletions src/util.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import util from "util";
import util from "node:util";
import { AstQuery } from "./astQuery.js";

class Util {
Expand Down Expand Up @@ -38,4 +38,4 @@ class Util {
}
}

export { Util };
export { Util };
8 changes: 4 additions & 4 deletions webc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from "fs";
import fs from "node:fs";
import fastglob from "fast-glob";
import isGlob from "is-glob";
import path from "path";
import path from "node:path";

import { Path } from "./src/path.js";
import { AstSerializer } from "./src/ast.js";
Expand Down Expand Up @@ -82,7 +82,7 @@ class WebC {
if(mode === "component" || !content.startsWith("<!doctype ") && !content.startsWith("<!DOCTYPE")) {
content = `<!doctype html>${content}`;
}

return {
content,
mode,
Expand Down Expand Up @@ -288,4 +288,4 @@ class WebC {
}
}

export { WebC, ModuleScript, ComponentManager };
export { WebC, ModuleScript, ComponentManager };