@powerlines/plugin-alloy 0.26.227 → 0.26.228
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/core/components/infrastructure-file.cjs +1 -1
- package/dist/core/components/source-file.cjs +1 -1
- package/dist/helpers/capnp.cjs +141 -87
- package/dist/helpers/capnp.d.cts +20 -15
- package/dist/helpers/capnp.d.cts.map +1 -1
- package/dist/helpers/capnp.d.mts +20 -15
- package/dist/helpers/capnp.mjs +142 -87
- package/dist/helpers/index.cjs +0 -3
- package/dist/helpers/index.d.cts +2 -3
- package/dist/helpers/index.d.mts +2 -3
- package/dist/helpers/index.mjs +2 -3
- package/dist/index.cjs +1 -1
- package/dist/markdown/components/alert.cjs +74 -0
- package/dist/markdown/components/alert.d.cts +53 -0
- package/dist/markdown/components/alert.d.cts.map +1 -0
- package/dist/markdown/components/alert.d.mts +53 -0
- package/dist/markdown/components/alert.d.mts.map +1 -0
- package/dist/markdown/components/alert.mjs +69 -0
- package/dist/markdown/components/alert.mjs.map +1 -0
- package/dist/markdown/components/index.cjs +8 -1
- package/dist/markdown/components/index.d.cts +2 -1
- package/dist/markdown/components/index.d.mts +2 -1
- package/dist/markdown/components/index.mjs +2 -1
- package/dist/markdown/index.cjs +7 -0
- package/dist/markdown/index.d.cts +2 -1
- package/dist/markdown/index.d.mts +2 -1
- package/dist/markdown/index.mjs +2 -1
- package/dist/typescript/components/builtin-file.cjs +5 -3
- package/dist/typescript/components/builtin-file.d.cts +6 -0
- package/dist/typescript/components/builtin-file.d.cts.map +1 -1
- package/dist/typescript/components/builtin-file.d.mts +6 -0
- package/dist/typescript/components/builtin-file.mjs +5 -3
- package/dist/typescript/components/entry-file.cjs +1 -1
- package/dist/typescript/components/interface-declaration.cjs +1 -1
- package/dist/typescript/components/interface-declaration.d.mts +1 -1
- package/dist/typescript/components/interface-declaration.mjs +1 -1
- package/dist/typescript/components/object-declaration.cjs +2 -2
- package/dist/typescript/components/object-declaration.d.mts +1 -1
- package/dist/typescript/components/object-declaration.mjs +2 -2
- package/dist/typescript/components/tsdoc-schema.cjs +2 -2
- package/dist/typescript/components/tsdoc-schema.mjs +2 -2
- package/dist/typescript/components/tsdoc.cjs +1 -1
- package/dist/typescript/components/tsdoc.d.mts +1 -1
- package/dist/typescript/components/tsdoc.mjs +1 -1
- package/package.json +23 -22
- package/dist/helpers/typescript.cjs +0 -47
- package/dist/helpers/typescript.d.cts +0 -24
- package/dist/helpers/typescript.d.cts.map +0 -1
- package/dist/helpers/typescript.d.mts +0 -24
- package/dist/helpers/typescript.d.mts.map +0 -1
- package/dist/helpers/typescript.mjs +0 -47
- package/dist/helpers/typescript.mjs.map +0 -1
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { titleCase } from "@stryke/string-format/title-case";
|
|
2
|
-
import { stringifyValue } from "@powerlines/deepkit/utilities";
|
|
3
|
-
import { camelCase } from "@stryke/string-format/camel-case";
|
|
4
|
-
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
5
|
-
|
|
6
|
-
//#region src/helpers/typescript.ts
|
|
7
|
-
/**
|
|
8
|
-
* Generates a TypeScript object for the given reflection class.
|
|
9
|
-
*
|
|
10
|
-
* @param reflection - The reflection class to generate the object for.
|
|
11
|
-
* @param options - Options for generating the object.
|
|
12
|
-
* @returns A string containing the TypeScript object definition.
|
|
13
|
-
*/
|
|
14
|
-
function generateObjectDeclaration(reflection, options = {}) {
|
|
15
|
-
if (!reflection) return "";
|
|
16
|
-
return `
|
|
17
|
-
/**
|
|
18
|
-
* ${reflection.getDescription() || `${titleCase(options.overrideName || reflection.getClassName() || reflection.getName())} object instance`}.
|
|
19
|
-
*/
|
|
20
|
-
export const ${camelCase(options.overrideName || reflection.getName())}${options.overrideExtends !== false && (options.overrideExtends || reflection.getSuperReflectionClass()?.getName()) ? `: ${options.overrideExtends || reflection.getSuperReflectionClass()?.getName()}` : ""} = {
|
|
21
|
-
${reflection.getProperties().filter((item) => !item.isIgnored() && !isUndefined(options.defaultValues?.[item.getNameAsString()] ?? item.getAlias().reduce((ret, alias) => {
|
|
22
|
-
if (isUndefined(ret) && !isUndefined(options.defaultValues?.[alias])) return options.defaultValues?.[alias];
|
|
23
|
-
return ret;
|
|
24
|
-
}, void 0) ?? item.getDefaultValue())).sort((a, b) => a.isReadonly() && b.isReadonly() || !a.isReadonly() && !b.isReadonly() ? a.getNameAsString().localeCompare(b.getNameAsString()) : a.isReadonly() ? 1 : -1).map((item) => ` /**
|
|
25
|
-
* ${item.getDescription() || item.getTitle() || titleCase(item.getNameAsString())}
|
|
26
|
-
*
|
|
27
|
-
* @title ${item.getTitle() || titleCase(item.getNameAsString())}${item.getAlias().length ? `
|
|
28
|
-
${item.getAlias().map((alias) => ` * @alias ${alias}`).join("\n")}` : ""}${item.getDomain() ? `
|
|
29
|
-
* @domain ${item.getDomain()}` : ""}${item.getPermission().length ? `
|
|
30
|
-
${item.getPermission().map((permission) => ` * @permission ${permission}`).join("\n")}` : ""}${item.isInternal() ? `
|
|
31
|
-
* @internal` : ""}${item.isRuntime() ? `
|
|
32
|
-
* @runtime` : ""}${item.isReadonly() ? `
|
|
33
|
-
* @readonly` : ""}${item.isIgnored() ? `
|
|
34
|
-
* @ignored` : ""}${item.isHidden() ? `
|
|
35
|
-
* @hidden` : ""}
|
|
36
|
-
*/
|
|
37
|
-
${item.getNameAsString()}: ${stringifyValue(item.getType(), options.defaultValues?.[item.getNameAsString()] ?? item.getAlias().reduce((ret, alias) => {
|
|
38
|
-
if (isUndefined(ret) && !isUndefined(options.defaultValues?.[alias])) return options.defaultValues?.[alias];
|
|
39
|
-
return ret;
|
|
40
|
-
}, void 0) ?? item.getDefaultValue())}`).join(", \n")}
|
|
41
|
-
};
|
|
42
|
-
`;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
//#endregion
|
|
46
|
-
export { generateObjectDeclaration };
|
|
47
|
-
//# sourceMappingURL=typescript.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typescript.mjs","names":[],"sources":[],"mappings":""}
|