@power-plant/alloy-js 0.0.19 → 0.0.20
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/README.md +1 -1
- package/dist/generate.cjs +1 -0
- package/dist/generate.d.cts +25 -0
- package/dist/generate.d.cts.map +1 -0
- package/dist/generate.d.mts +25 -0
- package/dist/generate.d.mts.map +1 -0
- package/dist/generate.mjs +2 -0
- package/dist/generate.mjs.map +1 -0
- package/dist/render.d.cts +5 -5
- package/dist/render.d.mts +5 -5
- package/package.json +19 -4
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ The Power Plant monorepo is a collection of packages that are designed to work t
|
|
|
33
33
|
|
|
34
34
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
35
35
|
|
|
36
|
-
[](https://docs.stormsoftware.com/projects/power-plant) [](http://commitizen.github.io/cz-cli/)  
|
|
37
37
|
|
|
38
38
|
<!-- prettier-ignore-start -->
|
|
39
39
|
<!-- markdownlint-disable -->
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-CMqjfN_6.cjs"),t=require("./render.cjs");let n=require("@power-plant/core"),r=require("@power-plant/noop-output");r=e.t(r,1);async function i(e,i={},a={}){return(0,n.execute)({output:r.default,...i,generator:async()=>t.render(e)},a)}exports.generate=i;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Children } from "@alloy-js/core";
|
|
2
|
+
import { GeneratedDocument, GeneratorConfigObject, OutputConfig, UserConfig } from "@power-plant/core";
|
|
3
|
+
//#region src/generate.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Execute Alloy-js template components through a Power Plant execution context.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Creates an execution context via `execute`, then renders the Alloy-js template components with `render`. Use this as the top-level entry point; use `render` when already inside a running generator.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { generate } from "@power-plant/alloy-js/generate";
|
|
13
|
+
*
|
|
14
|
+
* await generate(<> ... </>);
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param template - The Alloy-js template components to render.
|
|
18
|
+
* @param config - A generator configuration object.
|
|
19
|
+
* @param options - Engine options for the execution context.
|
|
20
|
+
* @returns A promise that resolves when generation is complete.
|
|
21
|
+
*/
|
|
22
|
+
declare function generate<TSpec = any, TOptions extends object = object, TGeneratorConfig extends Omit<GeneratorConfigObject<TSpec, TOptions, any>, "generator"> = Omit<GeneratorConfigObject<TSpec, TOptions, Record<string, GeneratedDocument>>, "generator">, TReturns = TGeneratorConfig["output"] extends OutputConfig<TSpec, TOptions, infer TOutputReturns> ? TOutputReturns : any>(template: Children, config?: TGeneratorConfig, options?: UserConfig & TOptions): Promise<TReturns>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { generate };
|
|
25
|
+
//# sourceMappingURL=generate.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.cts","names":[],"sources":["../src/generate.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;iBAgDsB,SACpB,aACA,kCACA,yBAAyB,KACvB,sBAAsB,OAAO,+BAE3B,KACF,sBAAsB,OAAO,UAAU,eAAe,mCAGxD,WAAW,mCAAmC,aAC5C,OACA,gBACM,kBAEJ,sBAGJ,UAAU,UACV,SAAQ,kBACR,UAAS,aAAa,WACrB,QAAQ"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { Children } from "@alloy-js/core";
|
|
2
|
+
import { GeneratedDocument, GeneratorConfigObject, OutputConfig, UserConfig } from "@power-plant/core";
|
|
3
|
+
//#region src/generate.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Execute Alloy-js template components through a Power Plant execution context.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Creates an execution context via `execute`, then renders the Alloy-js template components with `render`. Use this as the top-level entry point; use `render` when already inside a running generator.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* import { generate } from "@power-plant/alloy-js/generate";
|
|
13
|
+
*
|
|
14
|
+
* await generate(<> ... </>);
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* @param template - The Alloy-js template components to render.
|
|
18
|
+
* @param config - A generator configuration object.
|
|
19
|
+
* @param options - Engine options for the execution context.
|
|
20
|
+
* @returns A promise that resolves when generation is complete.
|
|
21
|
+
*/
|
|
22
|
+
declare function generate<TSpec = any, TOptions extends object = object, TGeneratorConfig extends Omit<GeneratorConfigObject<TSpec, TOptions, any>, "generator"> = Omit<GeneratorConfigObject<TSpec, TOptions, Record<string, GeneratedDocument>>, "generator">, TReturns = TGeneratorConfig["output"] extends OutputConfig<TSpec, TOptions, infer TOutputReturns> ? TOutputReturns : any>(template: Children, config?: TGeneratorConfig, options?: UserConfig & TOptions): Promise<TReturns>;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { generate };
|
|
25
|
+
//# sourceMappingURL=generate.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.d.mts","names":[],"sources":["../src/generate.ts"],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate.mjs","names":[],"sources":[],"mappings":""}
|
package/dist/render.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { Children } from "@alloy-js/core";
|
|
|
2
2
|
import { ExecutionContext, GeneratorFunctionResult } from "@power-plant/core";
|
|
3
3
|
//#region src/render.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* A function to render
|
|
5
|
+
* A function to render template components within the [Alloy-js](https://alloy-framework.github.io) context, and register any generated documents on the execution context.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx
|
|
@@ -12,10 +12,10 @@ import { ExecutionContext, GeneratorFunctionResult } from "@power-plant/core";
|
|
|
12
12
|
* ```
|
|
13
13
|
*
|
|
14
14
|
* @param context - The Power Plant execution context.
|
|
15
|
-
* @param
|
|
15
|
+
* @param template - The children components to render.
|
|
16
16
|
* @returns A promise that resolves when rendering is complete.
|
|
17
17
|
*/
|
|
18
|
-
declare function renderBase<TSpec, TOptions extends object, TReturns = void>(context: ExecutionContext<TSpec, TOptions, TReturns>,
|
|
18
|
+
declare function renderBase<TSpec, TOptions extends object, TReturns = void>(context: ExecutionContext<TSpec, TOptions, TReturns>, template: Children): Promise<GeneratorFunctionResult<TSpec, TOptions>>;
|
|
19
19
|
/**
|
|
20
20
|
* A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and register any generated documents on the execution context.
|
|
21
21
|
*
|
|
@@ -26,10 +26,10 @@ declare function renderBase<TSpec, TOptions extends object, TReturns = void>(con
|
|
|
26
26
|
* await render(<> ... </>);
|
|
27
27
|
* ```
|
|
28
28
|
*
|
|
29
|
-
* @param
|
|
29
|
+
* @param template - The children components to render.
|
|
30
30
|
* @returns A promise that resolves when rendering is complete.
|
|
31
31
|
*/
|
|
32
|
-
declare function render<TSpec, TOptions extends object, TReturns = void>(
|
|
32
|
+
declare function render<TSpec, TOptions extends object, TReturns = void>(template: Children): Promise<GeneratorFunctionResult<TSpec, TOptions>>;
|
|
33
33
|
//#endregion
|
|
34
34
|
export { render, renderBase };
|
|
35
35
|
//# sourceMappingURL=render.d.cts.map
|
package/dist/render.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { Children } from "@alloy-js/core";
|
|
|
2
2
|
import { ExecutionContext, GeneratorFunctionResult } from "@power-plant/core";
|
|
3
3
|
//#region src/render.d.ts
|
|
4
4
|
/**
|
|
5
|
-
* A function to render
|
|
5
|
+
* A function to render template components within the [Alloy-js](https://alloy-framework.github.io) context, and register any generated documents on the execution context.
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* ```tsx
|
|
@@ -12,10 +12,10 @@ import { ExecutionContext, GeneratorFunctionResult } from "@power-plant/core";
|
|
|
12
12
|
* ```
|
|
13
13
|
*
|
|
14
14
|
* @param context - The Power Plant execution context.
|
|
15
|
-
* @param
|
|
15
|
+
* @param template - The children components to render.
|
|
16
16
|
* @returns A promise that resolves when rendering is complete.
|
|
17
17
|
*/
|
|
18
|
-
declare function renderBase<TSpec, TOptions extends object, TReturns = void>(context: ExecutionContext<TSpec, TOptions, TReturns>,
|
|
18
|
+
declare function renderBase<TSpec, TOptions extends object, TReturns = void>(context: ExecutionContext<TSpec, TOptions, TReturns>, template: Children): Promise<GeneratorFunctionResult<TSpec, TOptions>>;
|
|
19
19
|
/**
|
|
20
20
|
* A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and register any generated documents on the execution context.
|
|
21
21
|
*
|
|
@@ -26,10 +26,10 @@ declare function renderBase<TSpec, TOptions extends object, TReturns = void>(con
|
|
|
26
26
|
* await render(<> ... </>);
|
|
27
27
|
* ```
|
|
28
28
|
*
|
|
29
|
-
* @param
|
|
29
|
+
* @param template - The children components to render.
|
|
30
30
|
* @returns A promise that resolves when rendering is complete.
|
|
31
31
|
*/
|
|
32
|
-
declare function render<TSpec, TOptions extends object, TReturns = void>(
|
|
32
|
+
declare function render<TSpec, TOptions extends object, TReturns = void>(template: Children): Promise<GeneratorFunctionResult<TSpec, TOptions>>;
|
|
33
33
|
//#endregion
|
|
34
34
|
export { render, renderBase };
|
|
35
35
|
//# sourceMappingURL=render.d.mts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@power-plant/alloy-js",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Power Plant generator for using Alloy JS to generate source code.",
|
|
6
6
|
"keywords": [
|
|
@@ -297,6 +297,20 @@
|
|
|
297
297
|
"default": "./dist/core/types/components.mjs"
|
|
298
298
|
}
|
|
299
299
|
},
|
|
300
|
+
"./generate": {
|
|
301
|
+
"require": {
|
|
302
|
+
"types": "./dist/generate.d.cts",
|
|
303
|
+
"default": "./dist/generate.cjs"
|
|
304
|
+
},
|
|
305
|
+
"import": {
|
|
306
|
+
"types": "./dist/generate.d.mts",
|
|
307
|
+
"default": "./dist/generate.mjs"
|
|
308
|
+
},
|
|
309
|
+
"default": {
|
|
310
|
+
"types": "./dist/generate.d.mts",
|
|
311
|
+
"default": "./dist/generate.mjs"
|
|
312
|
+
}
|
|
313
|
+
},
|
|
300
314
|
"./hcl": {
|
|
301
315
|
"require": {
|
|
302
316
|
"types": "./dist/hcl/index.d.cts",
|
|
@@ -869,8 +883,9 @@
|
|
|
869
883
|
"@alloy-js/json": "^0.24.0",
|
|
870
884
|
"@alloy-js/markdown": "^0.24.0",
|
|
871
885
|
"@alloy-js/typescript": "^0.24.0",
|
|
872
|
-
"@power-plant/core": "^0.0.
|
|
873
|
-
"@power-plant/schema": "^0.0.
|
|
886
|
+
"@power-plant/core": "^0.0.23",
|
|
887
|
+
"@power-plant/schema": "^0.0.22",
|
|
888
|
+
"@power-plant/noop-output": "^0.0.2",
|
|
874
889
|
"@stryke/convert": "^0.7.27",
|
|
875
890
|
"@stryke/helpers": "^0.10.36",
|
|
876
891
|
"@stryke/path": "^0.29.23",
|
|
@@ -892,5 +907,5 @@
|
|
|
892
907
|
"peerDependencies": { "@alloy-js/babel-preset": ">=0.3.0" },
|
|
893
908
|
"peerDependenciesMeta": { "@alloy-js/babel-preset": { "optional": false } },
|
|
894
909
|
"publishConfig": { "access": "public" },
|
|
895
|
-
"gitHead": "
|
|
910
|
+
"gitHead": "684f2460a2bb943d952d3e608e8c124f0a5b6301"
|
|
896
911
|
}
|