einsteinjs 0.1.0 → 0.1.1

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/dist/index.d.ts CHANGED
@@ -61,19 +61,6 @@ interface Config {
61
61
  */
62
62
  declare function defineConfig(config: Config): Config;
63
63
 
64
- /**
65
- * Processo completo:
66
- *
67
- * builder
68
- * ↓
69
- * schema validation
70
- * ↓
71
- * semantic validation
72
- * ↓
73
- * compilation
74
- * ↓
75
- * output
76
- */
77
64
  declare function build(config: Config): Promise<void>;
78
65
 
79
66
  /**
package/dist/index.js CHANGED
@@ -5,7 +5,8 @@ var __export = (target, all) => {
5
5
  };
6
6
 
7
7
  // src/build.ts
8
- import { writeFile } from "fs/promises";
8
+ import { mkdir, writeFile } from "fs/promises";
9
+ import { dirname } from "path";
9
10
 
10
11
  // src/compiler/compile-snippet.ts
11
12
  function compileSnippet(snippet) {
@@ -14596,9 +14597,14 @@ async function build(config2) {
14596
14597
  validateDuplicateNames(snippets);
14597
14598
  validateDuplicatePrefixes(snippets);
14598
14599
  const json2 = compile(snippets);
14600
+ const outputDir = dirname(config2.output);
14601
+ await mkdir(outputDir, {
14602
+ recursive: true
14603
+ });
14599
14604
  await writeFile(
14600
14605
  config2.output,
14601
- JSON.stringify(json2, null, 4)
14606
+ JSON.stringify(json2, null, 2),
14607
+ "utf-8"
14602
14608
  );
14603
14609
  }
14604
14610
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "einsteinjs",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",