chocola 1.1.0 → 1.1.2

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/index.js ADDED
@@ -0,0 +1,3 @@
1
+ import runtime from "./runtime/index.js";
2
+
3
+ export async function build(__rootdir, __srcdir) { runtime(__rootdir, __srcdir); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chocola",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Chocola pipeline for web apps.",
5
5
  "keywords": [
6
6
  "web",
@@ -21,5 +21,8 @@
21
21
  "dependencies": {
22
22
  "chalk": "^5.6.2",
23
23
  "jsdom": "^27.4.0"
24
+ },
25
+ "devDependencies": {
26
+ "js-beautify": "^1.15.4"
24
27
  }
25
28
  }
package/runtime/index.js CHANGED
@@ -4,6 +4,7 @@ import path from "path";
4
4
  import { promises as fs } from "fs";
5
5
  import { getComponents, getSrcIndex } from "./pipeline.js";
6
6
  import chalk from 'chalk';
7
+ import beautify from "js-beautify";
7
8
 
8
9
 
9
10
  const logSeparation = chalk.yellow(`
@@ -11,7 +12,7 @@ ________________________________________________________________________
11
12
  ========================================================================
12
13
  `)
13
14
 
14
- export async function build(__rootdir, __srcdir) {
15
+ export default async function runtime(__rootdir, __srcdir) {
15
16
  console.log(chalk.bold.hex("#945e33")(`\n RUNNING CHOCOLA BUNDLER`))
16
17
  console.log(logSeparation);
17
18
  console.log(chalk.hex("#945e33")(`
@@ -101,7 +102,8 @@ export async function build(__rootdir, __srcdir) {
101
102
  });
102
103
 
103
104
  const finalHtml = dom.serialize();
104
- await fs.writeFile(path.join(outDirPath, "index.html"), finalHtml);
105
+ const prettyHtml = beautify.html(finalHtml, { indent_size: 2 });
106
+ await fs.writeFile(path.join(outDirPath, "index.html"), prettyHtml);
105
107
 
106
108
 
107
109
  console.log(`