Skip to content

Commit 3ae2337

Browse files
committed
Remove logs
1 parent aded4d9 commit 3ae2337

File tree

7 files changed

+35
-33
lines changed

7 files changed

+35
-33
lines changed

.changeset/olive-clocks-wave.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@code-hike/lighter": minor
3+
---
4+
5+
Remove logs

lib/dist/index.cjs.js

+10-11
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/dist/index.esm.mjs

+10-11
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ async function readJSON(folder, filename) {
450450
}
451451
return JSON.parse(result);
452452
} catch (e) {
453-
console.log("using resolve");
453+
// console.log("using resolve");
454454
const indexFile = resolveSync("@code-hike/lighter", { basedir: __dirname });
455455
let folderPath = path.resolve(indexFile, "..", "..", folder);
456456
let filepath = path.resolve(folderPath, filename);
@@ -2561,19 +2561,19 @@ const idDepsById = {
25612561
// theme?name=${name}
25622562
async function fetchJSON(endpoint) {
25632563
if (typeof fetch === "function") {
2564-
console.log(
2565-
`using fetch`,
2566-
`https://lighter.codehike.org/api/${endpoint}&v=${"0.1.9"}`
2567-
);
2564+
// console.log(
2565+
// `using fetch`,
2566+
// `https://lighter.codehike.org/api/${endpoint}&v=${"0.1.9"}`
2567+
// );
25682568
const r = await fetch(
25692569
`https://lighter.codehike.org/api/${endpoint}&v=${"0.1.9"}`
25702570
);
25712571
return await r.json();
25722572
}
2573-
console.log(
2574-
`using https`,
2575-
`https://lighter.codehike.org/api/${endpoint}&v=${"0.1.9"}`
2576-
);
2573+
// console.log(
2574+
// `using https`,
2575+
// `https://lighter.codehike.org/api/${endpoint}&v=${"0.1.9"}`
2576+
// );
25772577

25782578
const https = await import('https');
25792579
const options = {
@@ -2637,7 +2637,7 @@ async function loadGrammarByScope(scope) {
26372637

26382638
// if (!shouldUseFileSystem)
26392639
const deps = getLanguagesToLoad(lang.id);
2640-
console.log("loading from network", lang.id);
2640+
// console.log("loading from network", lang.id);
26412641
const fetchPromise = fetchJSON(`grammars?lang=${lang.id}`);
26422642
deps.forEach((l) => {
26432643
if (!sourceToGrammarPromise.has(l.scopeName)) {
@@ -2914,7 +2914,6 @@ async function loadTheme(name) {
29142914
themeCache.set(name, loadedTheme);
29152915
return loadedTheme;
29162916
} catch (e) {
2917-
console.log("fallback to network", e);
29182917
return await fetchJSON(`theme?name=${name}`);
29192918
}
29202919
}

lib/src/file-system.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export async function readJSON(folder, filename) {
1414
}
1515
return JSON.parse(result);
1616
} catch (e) {
17-
console.log("using resolve");
17+
// console.log("using resolve");
1818
const indexFile = resolveSync("@code-hike/lighter", { basedir: __dirname });
1919
let folderPath = path.resolve(indexFile, "..", "..", folder);
2020
let filepath = path.resolve(folderPath, filename);

lib/src/grammars.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export async function loadGrammarByScope(scope) {
3838

3939
// if (!shouldUseFileSystem)
4040
const deps = getLanguagesToLoad(lang.id);
41-
console.log("loading from network", lang.id);
41+
// console.log("loading from network", lang.id);
4242
const fetchPromise = fetchJSON(`grammars?lang=${lang.id}`);
4343
deps.forEach((l) => {
4444
if (!sourceToGrammarPromise.has(l.scopeName)) {

lib/src/load.js

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export async function loadTheme(name) {
1313
themeCache.set(name, loadedTheme);
1414
return loadedTheme;
1515
} catch (e) {
16-
console.log("fallback to network", e);
1716
return await fetchJSON(`theme?name=${name}`);
1817
}
1918
}

lib/src/network.js

+8-8
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
// theme?name=${name}
44
export async function fetchJSON(endpoint) {
55
if (typeof fetch === "function") {
6-
console.log(
7-
`using fetch`,
8-
`https://lighter.codehike.org/api/${endpoint}&v=${__LIGHTER_VERSION__}`
9-
);
6+
// console.log(
7+
// `using fetch`,
8+
// `https://lighter.codehike.org/api/${endpoint}&v=${__LIGHTER_VERSION__}`
9+
// );
1010
const r = await fetch(
1111
`https://lighter.codehike.org/api/${endpoint}&v=${__LIGHTER_VERSION__}`
1212
);
1313
return await r.json();
1414
}
15-
console.log(
16-
`using https`,
17-
`https://lighter.codehike.org/api/${endpoint}&v=${__LIGHTER_VERSION__}`
18-
);
15+
// console.log(
16+
// `using https`,
17+
// `https://lighter.codehike.org/api/${endpoint}&v=${__LIGHTER_VERSION__}`
18+
// );
1919

2020
const https = await import("https");
2121
const options = {

0 commit comments

Comments
 (0)