chocola 1.1.5 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/compiler/index.js CHANGED
@@ -2,7 +2,7 @@ import { throwError, genRandomId, incrementAlfabet } from "./utils.js";
2
2
  import { JSDOM } from "jsdom";
3
3
  import path from "path";
4
4
  import { promises as fs } from "fs";
5
- import { getComponents, getSrcIndex, processStylesheet } from "./pipeline.js";
5
+ import { getComponents, getSrcIndex, processIcons, processStylesheet } from "./pipeline.js";
6
6
  import chalk from 'chalk';
7
7
  import beautify from "js-beautify";
8
8
  import { getChocolaConfig } from "../utils.js";
@@ -171,6 +171,7 @@ ${letter}RUNTIME(${letter}, ${JSON.stringify(ctx)});`);
171
171
  for (const link of docLinks) {
172
172
  const rel = link.rel;
173
173
  if (rel === "stylesheet") await processStylesheet(link, __rootdir, __srcdir, outDirPath, fileIds);
174
+ if (rel === "icon") await processIcons(link, __rootdir, __srcdir, outDirPath, fileIds)
174
175
  }
175
176
 
176
177
 
@@ -113,3 +113,12 @@ export async function processStylesheet(link, __rootdir, __srcdir, outDirPath, f
113
113
  }
114
114
  }
115
115
 
116
+ export async function processIcons(link, __rootdir, __srcdir, outDirPath) {
117
+ try {
118
+ const href = link.href;
119
+ const iconPath = path.join(__rootdir, __srcdir, href);
120
+ await fs.copyFile(iconPath, path.join(outDirPath, href));
121
+ } catch (err) {
122
+ throwError(err)
123
+ }
124
+ }
package/dev/index.js CHANGED
@@ -10,7 +10,7 @@ export async function serve(__rootdir) {
10
10
 
11
11
  let __outdir = "dist";
12
12
  let __config = {
13
- hostname: "127.0.0.1",
13
+ hostname: "localhost",
14
14
  port: 3000,
15
15
  }
16
16
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chocola",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "Chocola pipeline for web apps.",
5
5
  "keywords": [
6
6
  "web",