Skip to content

Commit ade3178

Browse files
committed
Remove debugging statements
1 parent 68630e3 commit ade3178

File tree

3 files changed

+4
-42
lines changed

3 files changed

+4
-42
lines changed

_extensions/sverto/compile-imports.ts

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,12 @@
22

33
import * as path from "https://deno.land/std/path/mod.ts";
44

5-
const scriptPath = path.fromFileUrl(import.meta.url);
6-
// console.log("Compile file is: " + scriptPath);
5+
const thisScript = path.fromFileUrl(import.meta.url);
6+
const rollupConfig = path.join(path.dirname(thisScript), "rollup.config.js");
77

8-
const rollupConfig = path.join(path.dirname(scriptPath), "rollup.config.js");
9-
10-
// now call rollup with the config file
8+
// call rollup with the config file
119
const cmd = ["npm", "run", "build", rollupConfig];
1210
const compileStep = Deno.run({ cmd });
1311
await compileStep.status();
14-
// console.log("Svelte compilation + bundling done!");
1512

16-
// let extensionDir = null;
17-
18-
// for await (const dirEntry of Deno.readDir("/_extensions")) {
19-
// console.log(dirEntry.name);
20-
// if (dirEntry.name == "sverto") {
21-
// extensionDir = "_extensions/sverto"
22-
// } else if (dirEntry.name == "360-info") {
23-
// // now iterate inside _extensions/360-info
24-
// extensionDir = "_extensions/sverto"
25-
// } else {
26-
// console.error("No sverto extension found ")
27-
// }
28-
// }
13+
// console.log("Svelte compilation + bundling done!");

_extensions/sverto/create-imports.lua

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -11,60 +11,40 @@ for in_file in string.gmatch(in_file_string, "([^\n]+)") do
1111
table.insert(in_files, in_file)
1212
end
1313

14-
-- print("--------------")
15-
-- print(">>> PRERENDER")
16-
-- print("Files going in:")
17-
-- print(in_file_string)
18-
-- print("--------------")
19-
2014
-- test case: single file (we want to do this for all files!)
2115

2216
first_file_name = in_files[1]
23-
2417
first_file = io.open(first_file_name, "r")
25-
-- print(">>> PRERENDER: CONTENT OF FIRST FILE: " .. first_file_name)
2618
first_file_contents = pandoc.read(io.output(first_file):read("a"))
27-
-- print(first_file_contents)
2819

2920
-- check if there's svelte in the frontmatter
3021

31-
3222
svelte_key = first_file_contents.meta["svelte"]
3323

3424
if (svelte_key) then
35-
-- print("Found a svelte key in the frontmatter")
3625
import_block = "```{ojs}\n"
3726
for i, item in ipairs(svelte_key) do
3827
-- TODO - assert item is a pandoc string
3928

4029
item_string = pandoc.utils.stringify(item)
4130
item_js = string.sub(item_string, 1, string.len(item_string) - 7)
42-
-- print(" - " .. item_string .. " => " .. item_js .. ".js")
4331

4432
-- write the item out to .sverto/.svelte-imports
4533
import_list_file = io.open(".sverto/.sverto-imports", "a")
4634
io.output(import_list_file):write(item_string .. "\n")
47-
print("Added to .sverto/.sverto-imports")
4835
io.close(import_list_file)
4936

5037
-- add the item to the require block
51-
-- print(">>>>>> Next item:")
52-
-- print(item_js .. ".js")
5338
import_block = import_block ..
5439
item_js .. " = import(\"/" .. item_js ..".js\")\n"
5540

5641
end
5742

5843
-- write the import block out to .sverto/[path]
5944
import_block = import_block .. "```"
60-
-- print("Import block:")
61-
-- print(import_block)
62-
-- print("Writing out to " .. ".sverto/" .. first_file_name)
6345
import_file = io.open(".sverto/" .. first_file_name, "w")
6446
io.output(import_file):write(import_block .. "\n")
6547
io.close(import_file)
66-
else
67-
-- print("No svelte key in " .. first_file_name)
6848
end
6949

7050
-- write the output dir temporarily

_extensions/sverto/rollup.config.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ const svelteFiles = fs.readFileSync('.sverto/.sverto-imports', 'utf8')
4242
// remove duplicate svelte components (being used by several qmds)
4343
const uniqueSvelteFiles = [... new Set(svelteFiles)]
4444

45-
console.log(">>> ROLLUP: QUARTO OUTPUT DIR IS ", quartoOutDir);
46-
console.log(">>> ROLLUP: SVELTE FILES ARE... ", uniqueSvelteFiles);
47-
4845
// we export an array of rollup configs: one for each input svelte file
4946
export default uniqueSvelteFiles.map(
5047
svelteFile => ({

0 commit comments

Comments
 (0)