einsteinjs 0.1.3 → 0.1.4
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 +12 -1
- package/dist/index.js +6 -9
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -97,7 +97,18 @@ interface Config {
|
|
|
97
97
|
*/
|
|
98
98
|
declare function defineConfig(config: Config): Config;
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
/**
|
|
101
|
+
* API pública.
|
|
102
|
+
*
|
|
103
|
+
* Permite:
|
|
104
|
+
*
|
|
105
|
+
* await build(
|
|
106
|
+
* tsx,
|
|
107
|
+
* jsx,
|
|
108
|
+
* html
|
|
109
|
+
* )
|
|
110
|
+
*/
|
|
111
|
+
declare function build(...configs: Config[]): Promise<void>;
|
|
101
112
|
|
|
102
113
|
/**
|
|
103
114
|
* API pública:
|
package/dist/index.js
CHANGED
|
@@ -14603,10 +14603,8 @@ var snippetSchema = external_exports.object({
|
|
|
14603
14603
|
});
|
|
14604
14604
|
|
|
14605
14605
|
// src/build.ts
|
|
14606
|
-
async function
|
|
14607
|
-
const snippets = config2.snippets.map(
|
|
14608
|
-
(snippet) => snippet.build()
|
|
14609
|
-
);
|
|
14606
|
+
async function buildConfig(config2) {
|
|
14607
|
+
const snippets = config2.snippets.map((snippet) => snippet.build());
|
|
14610
14608
|
for (const snippet of snippets) {
|
|
14611
14609
|
snippetSchema.parse(snippet);
|
|
14612
14610
|
}
|
|
@@ -14617,11 +14615,10 @@ async function build(config2) {
|
|
|
14617
14615
|
await mkdir(outputDir, {
|
|
14618
14616
|
recursive: true
|
|
14619
14617
|
});
|
|
14620
|
-
await writeFile(
|
|
14621
|
-
|
|
14622
|
-
|
|
14623
|
-
|
|
14624
|
-
);
|
|
14618
|
+
await writeFile(config2.output, JSON.stringify(json2, null, 4), "utf-8");
|
|
14619
|
+
}
|
|
14620
|
+
async function build(...configs) {
|
|
14621
|
+
await Promise.all(configs.map(buildConfig));
|
|
14625
14622
|
}
|
|
14626
14623
|
|
|
14627
14624
|
// src/define-config.ts
|