einsteinjs 0.1.4 → 0.1.5
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.js +28 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -77,6 +77,19 @@ function validateDuplicatePrefixes(snippets) {
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
// src/logger.ts
|
|
81
|
+
var logger = {
|
|
82
|
+
info(message) {
|
|
83
|
+
console.log(`\u2728 EinsteinJS ${message}`);
|
|
84
|
+
},
|
|
85
|
+
success(message) {
|
|
86
|
+
console.log(`\u2705 EinsteinJS ${message}`);
|
|
87
|
+
},
|
|
88
|
+
error(message) {
|
|
89
|
+
console.error(`\u274C EinsteinJS ${message}`);
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
|
|
80
93
|
// node_modules/zod/v4/classic/external.js
|
|
81
94
|
var external_exports = {};
|
|
82
95
|
__export(external_exports, {
|
|
@@ -14616,9 +14629,23 @@ async function buildConfig(config2) {
|
|
|
14616
14629
|
recursive: true
|
|
14617
14630
|
});
|
|
14618
14631
|
await writeFile(config2.output, JSON.stringify(json2, null, 4), "utf-8");
|
|
14632
|
+
return {
|
|
14633
|
+
output: config2.output,
|
|
14634
|
+
snippets: snippets.length
|
|
14635
|
+
};
|
|
14619
14636
|
}
|
|
14620
14637
|
async function build(...configs) {
|
|
14621
|
-
await Promise.all(configs.map(buildConfig));
|
|
14638
|
+
const results = await Promise.all(configs.map(buildConfig));
|
|
14639
|
+
const totalSnippets = results.reduce(
|
|
14640
|
+
(acc, result) => acc + result.snippets,
|
|
14641
|
+
0
|
|
14642
|
+
);
|
|
14643
|
+
logger.success(
|
|
14644
|
+
`Generated ${results.length} file(s) from ${totalSnippets} snippet(s).`
|
|
14645
|
+
);
|
|
14646
|
+
for (const result of results) {
|
|
14647
|
+
logger.info(result.output);
|
|
14648
|
+
}
|
|
14622
14649
|
}
|
|
14623
14650
|
|
|
14624
14651
|
// src/define-config.ts
|