@powerlines/plugin-date 0.12.259 → 0.12.260
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/components/date-fns.cjs +2 -3
- package/dist/components/date-fns.mjs +1 -1
- package/dist/components/dayjs.cjs +2 -3
- package/dist/components/dayjs.mjs +1 -1
- package/dist/components/luxon.cjs +2 -3
- package/dist/components/luxon.mjs +1 -1
- package/dist/components/moment.cjs +2 -3
- package/dist/components/moment.mjs +1 -1
- package/dist/deepkit/schemas/reflection.cjs +3998 -0
- package/dist/deepkit/schemas/reflection.mjs +3996 -0
- package/dist/deepkit/schemas/reflection2.cjs +4112 -0
- package/dist/deepkit/schemas/reflection2.mjs +4110 -0
- package/dist/deepkit/src/capnp.cjs +913 -0
- package/dist/deepkit/src/capnp.mjs +911 -0
- package/dist/deepkit/src/esbuild-plugin.cjs +47 -0
- package/dist/deepkit/src/esbuild-plugin.mjs +46 -0
- package/dist/deepkit/src/reflect-type.cjs +22 -0
- package/dist/deepkit/src/reflect-type.mjs +20 -0
- package/dist/deepkit/src/resolve-reflections.cjs +16 -0
- package/dist/deepkit/src/resolve-reflections.mjs +15 -0
- package/dist/deepkit/src/transformer.cjs +52 -0
- package/dist/deepkit/src/transformer.mjs +49 -0
- package/dist/deepkit/src/transpile.cjs +29 -0
- package/dist/deepkit/src/transpile.mjs +27 -0
- package/dist/deepkit/src/utilities.cjs +67 -0
- package/dist/deepkit/src/utilities.mjs +66 -0
- package/dist/index.cjs +5 -5
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +3 -3
- package/dist/plugin-alloy/src/core/components/output.cjs +36 -0
- package/dist/plugin-alloy/src/core/components/output.mjs +35 -0
- package/dist/plugin-alloy/src/core/components/single-line-comment.cjs +20 -0
- package/dist/plugin-alloy/src/core/components/single-line-comment.mjs +19 -0
- package/dist/plugin-alloy/src/core/components/source-file.cjs +60 -0
- package/dist/plugin-alloy/src/core/components/source-file.mjs +58 -0
- package/dist/plugin-alloy/src/core/contexts/context.cjs +38 -0
- package/dist/plugin-alloy/src/core/contexts/context.mjs +34 -0
- package/dist/plugin-alloy/src/core/contexts/index.cjs +2 -0
- package/dist/plugin-alloy/src/core/contexts/index.mjs +4 -0
- package/dist/plugin-alloy/src/core/contexts/reflection.cjs +46 -0
- package/dist/plugin-alloy/src/core/contexts/reflection.mjs +42 -0
- package/dist/plugin-alloy/src/helpers/refkey.cjs +16 -0
- package/dist/plugin-alloy/src/helpers/refkey.mjs +15 -0
- package/dist/plugin-alloy/src/index.cjs +102 -0
- package/dist/plugin-alloy/src/index.mjs +100 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-file.cjs +89 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-file.mjs +88 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-table.cjs +33 -0
- package/dist/plugin-alloy/src/markdown/components/markdown-table.mjs +32 -0
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.cjs +18 -0
- package/dist/plugin-alloy/src/markdown/contexts/markdown-table.mjs +17 -0
- package/dist/plugin-alloy/src/types/components.d.mts +3 -0
- package/dist/plugin-alloy/src/types/index.d.mts +2 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.cjs +52 -0
- package/dist/plugin-alloy/src/typescript/components/builtin-file.mjs +51 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.cjs +78 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc-reflection.mjs +76 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.cjs +364 -0
- package/dist/plugin-alloy/src/typescript/components/tsdoc.mjs +355 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.cjs +157 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-file.mjs +154 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.cjs +57 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-interface.mjs +56 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-object.cjs +94 -0
- package/dist/plugin-alloy/src/typescript/components/typescript-object.mjs +93 -0
- package/dist/plugin-automd/src/index.cjs +101 -0
- package/dist/plugin-automd/src/index.mjs +98 -0
- package/dist/{packages/plugin-automd → plugin-automd}/src/types/plugin.d.mts +3 -1
- package/dist/plugin-babel/src/helpers/ast-utils.cjs +10 -0
- package/dist/plugin-babel/src/helpers/ast-utils.mjs +9 -0
- package/dist/plugin-babel/src/helpers/create-plugin.cjs +41 -0
- package/dist/plugin-babel/src/helpers/create-plugin.mjs +39 -0
- package/dist/plugin-babel/src/helpers/filters.cjs +23 -0
- package/dist/plugin-babel/src/helpers/filters.mjs +21 -0
- package/dist/plugin-babel/src/helpers/index.cjs +5 -0
- package/dist/plugin-babel/src/helpers/index.mjs +7 -0
- package/dist/plugin-babel/src/helpers/module-helpers.cjs +38 -0
- package/dist/plugin-babel/src/helpers/module-helpers.mjs +35 -0
- package/dist/plugin-babel/src/helpers/options.cjs +49 -0
- package/dist/plugin-babel/src/helpers/options.mjs +46 -0
- package/dist/plugin-babel/src/index.cjs +85 -0
- package/dist/plugin-babel/src/index.mjs +83 -0
- package/dist/plugin-babel/src/types/index.d.mts +1 -0
- package/dist/plugin-env/src/babel/index.cjs +1 -0
- package/dist/plugin-env/src/babel/index.mjs +3 -0
- package/dist/plugin-env/src/babel/plugin.cjs +70 -0
- package/dist/plugin-env/src/babel/plugin.mjs +69 -0
- package/dist/plugin-env/src/components/docs.cjs +60 -0
- package/dist/plugin-env/src/components/docs.mjs +59 -0
- package/dist/plugin-env/src/components/env.cjs +497 -0
- package/dist/plugin-env/src/components/env.mjs +494 -0
- package/dist/plugin-env/src/components/index.cjs +2 -0
- package/dist/plugin-env/src/components/index.mjs +4 -0
- package/dist/plugin-env/src/helpers/automd-generator.cjs +22 -0
- package/dist/plugin-env/src/helpers/automd-generator.mjs +21 -0
- package/dist/plugin-env/src/helpers/create-reflection-resource.cjs +55 -0
- package/dist/plugin-env/src/helpers/create-reflection-resource.mjs +54 -0
- package/dist/plugin-env/src/helpers/docs-helper.cjs +16 -0
- package/dist/plugin-env/src/helpers/docs-helper.mjs +15 -0
- package/dist/plugin-env/src/helpers/index.cjs +6 -0
- package/dist/plugin-env/src/helpers/index.mjs +8 -0
- package/dist/plugin-env/src/helpers/load.cjs +84 -0
- package/dist/plugin-env/src/helpers/load.mjs +81 -0
- package/dist/plugin-env/src/helpers/persistence.cjs +201 -0
- package/dist/plugin-env/src/helpers/persistence.mjs +190 -0
- package/dist/plugin-env/src/helpers/reflect.cjs +125 -0
- package/dist/plugin-env/src/helpers/reflect.mjs +117 -0
- package/dist/plugin-env/src/helpers/source-file-env.cjs +24 -0
- package/dist/plugin-env/src/helpers/source-file-env.mjs +23 -0
- package/dist/plugin-env/src/helpers/template-helpers.cjs +2 -0
- package/dist/plugin-env/src/helpers/template-helpers.mjs +4 -0
- package/dist/plugin-env/src/index.cjs +174 -0
- package/dist/plugin-env/src/index.mjs +172 -0
- package/dist/{packages/plugin-env → plugin-env}/src/types/plugin.d.mts +3 -1
- package/dist/{packages/powerlines → powerlines}/src/internal/helpers/hooks.d.mts +2 -0
- package/dist/powerlines/src/lib/build/esbuild.cjs +93 -0
- package/dist/powerlines/src/lib/build/esbuild.mjs +91 -0
- package/dist/powerlines/src/lib/constants/environments.cjs +6 -0
- package/dist/powerlines/src/lib/constants/environments.mjs +5 -0
- package/dist/powerlines/src/lib/entry.cjs +11 -0
- package/dist/powerlines/src/lib/entry.mjs +13 -0
- package/dist/powerlines/src/lib/logger.cjs +41 -0
- package/dist/powerlines/src/lib/logger.mjs +39 -0
- package/dist/powerlines/src/lib/unplugin/helpers.cjs +3 -0
- package/dist/powerlines/src/lib/unplugin/helpers.mjs +5 -0
- package/dist/powerlines/src/lib/unplugin/module-resolution.cjs +66 -0
- package/dist/powerlines/src/lib/unplugin/module-resolution.mjs +65 -0
- package/dist/powerlines/src/lib/unplugin/plugin.cjs +46 -0
- package/dist/powerlines/src/lib/unplugin/plugin.mjs +45 -0
- package/dist/powerlines/src/lib/utilities/bundle.cjs +42 -0
- package/dist/powerlines/src/lib/utilities/bundle.mjs +40 -0
- package/dist/powerlines/src/lib/utilities/file-header.cjs +22 -0
- package/dist/powerlines/src/lib/utilities/file-header.mjs +21 -0
- package/dist/powerlines/src/lib/utilities/resolve.cjs +50 -0
- package/dist/powerlines/src/lib/utilities/resolve.mjs +49 -0
- package/dist/powerlines/src/lib/utilities/source-file.cjs +5 -0
- package/dist/powerlines/src/lib/utilities/source-file.mjs +5 -0
- package/dist/powerlines/src/plugin-utils/paths.cjs +1 -0
- package/dist/powerlines/src/plugin-utils/paths.mjs +3 -0
- package/dist/powerlines/src/types/build.cjs +21 -0
- package/dist/{packages/powerlines → powerlines}/src/types/build.d.mts +6 -6
- package/dist/powerlines/src/types/build.mjs +21 -0
- package/dist/{packages/powerlines → powerlines}/src/types/commands.d.mts +1 -0
- package/dist/{packages/powerlines → powerlines}/src/types/config.d.mts +3 -2
- package/dist/{packages/powerlines → powerlines}/src/types/context.d.mts +2 -2
- package/dist/{packages/powerlines → powerlines}/src/types/plugin.d.mts +1 -1
- package/dist/{packages/powerlines → powerlines}/src/types/tsconfig.d.mts +1 -1
- package/dist/{packages/powerlines → powerlines}/src/types/unplugin.d.mts +2 -1
- package/dist/types/plugin.d.mts +1 -1
- package/package.json +4 -4
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.cjs +0 -43
- package/dist/node_modules/.pnpm/defu@6.1.4/node_modules/defu/dist/defu.mjs +0 -42
- /package/dist/{packages/deepkit → deepkit}/schemas/reflection.d.mts +0 -0
- /package/dist/{packages/deepkit → deepkit}/src/types.d.mts +0 -0
- /package/dist/{packages/plugin-alloy → plugin-alloy}/src/types/plugin.d.mts +0 -0
- /package/dist/{packages/plugin-automd → plugin-automd}/src/types/toc.d.mts +0 -0
- /package/dist/{packages/plugin-babel → plugin-babel}/src/types/plugin.d.mts +0 -0
- /package/dist/{packages/plugin-env → plugin-env}/src/types/runtime.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/api.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/babel.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/fs.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/hooks.d.mts +0 -0
- /package/dist/{packages/powerlines → powerlines}/src/types/resolved.d.mts +0 -0
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
2
|
+
import { SingleLineComment } from "../../core/components/single-line-comment.mjs";
|
|
3
|
+
import { SourceFile } from "../../core/components/source-file.mjs";
|
|
4
|
+
import { Show, code, splitProps } from "@alloy-js/core";
|
|
5
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
6
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { Link } from "@alloy-js/markdown";
|
|
8
|
+
|
|
9
|
+
//#region ../plugin-alloy/src/markdown/components/markdown-file.tsx
|
|
10
|
+
/**
|
|
11
|
+
* A base component representing a Powerlines generated markdown source file.
|
|
12
|
+
*
|
|
13
|
+
* @param props - The properties for the source file.
|
|
14
|
+
* @returns The rendered source file component.
|
|
15
|
+
*/
|
|
16
|
+
function MarkdownFile(props) {
|
|
17
|
+
const [{ children, storage }, rest] = splitProps(props, ["children", "storage"]);
|
|
18
|
+
return /* @__PURE__ */ jsx(SourceFile, {
|
|
19
|
+
header: /* @__PURE__ */ jsx(MarkdownFileHeader, {}),
|
|
20
|
+
...rest,
|
|
21
|
+
filetype: "md",
|
|
22
|
+
reference: Link,
|
|
23
|
+
storage,
|
|
24
|
+
children: /* @__PURE__ */ jsx(Show, {
|
|
25
|
+
when: Boolean(children),
|
|
26
|
+
children
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Renders the header for a Powerlines Typescript source file.
|
|
32
|
+
*
|
|
33
|
+
* @param props - The properties for the source file header.
|
|
34
|
+
* @returns The rendered source file header.
|
|
35
|
+
*/
|
|
36
|
+
function MarkdownFileHeader(props) {
|
|
37
|
+
const [{ children, disableEslint = true, disableBiome = true, disablePrettier = false }] = splitProps(props, [
|
|
38
|
+
"children",
|
|
39
|
+
"disableEslint",
|
|
40
|
+
"disableBiome",
|
|
41
|
+
"disablePrettier"
|
|
42
|
+
]);
|
|
43
|
+
const context = usePowerlinesSafe();
|
|
44
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
45
|
+
/* @__PURE__ */ jsxs(Show, {
|
|
46
|
+
when: Boolean(disableEslint),
|
|
47
|
+
children: [/* @__PURE__ */ jsx(SingleLineComment, {
|
|
48
|
+
variant: "markdown",
|
|
49
|
+
children: "eslint-disable"
|
|
50
|
+
}), /* @__PURE__ */ jsx("hbr", {})]
|
|
51
|
+
}),
|
|
52
|
+
/* @__PURE__ */ jsxs(Show, {
|
|
53
|
+
when: Boolean(disablePrettier),
|
|
54
|
+
children: [/* @__PURE__ */ jsx(SingleLineComment, {
|
|
55
|
+
variant: "markdown",
|
|
56
|
+
children: "prettier-ignore"
|
|
57
|
+
}), /* @__PURE__ */ jsx("hbr", {})]
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ jsxs(Show, {
|
|
60
|
+
when: Boolean(disableBiome),
|
|
61
|
+
children: [/* @__PURE__ */ jsx(SingleLineComment, {
|
|
62
|
+
variant: "markdown",
|
|
63
|
+
children: "biome-ignore lint: disable"
|
|
64
|
+
}), /* @__PURE__ */ jsx("hbr", {})]
|
|
65
|
+
}),
|
|
66
|
+
/* @__PURE__ */ jsx(Show, {
|
|
67
|
+
when: Boolean(disableEslint) || Boolean(disablePrettier) || Boolean(disableBiome),
|
|
68
|
+
children: /* @__PURE__ */ jsx("hbr", {})
|
|
69
|
+
}),
|
|
70
|
+
/* @__PURE__ */ jsx(Show, {
|
|
71
|
+
when: Boolean(children),
|
|
72
|
+
children: /* @__PURE__ */ jsxs(Fragment, { children: [children, /* @__PURE__ */ jsx("hbr", {})] })
|
|
73
|
+
}),
|
|
74
|
+
/* @__PURE__ */ jsx(SingleLineComment, {
|
|
75
|
+
variant: "markdown",
|
|
76
|
+
children: `Generated by ${titleCase(context?.config?.framework) || "Powerlines"}`
|
|
77
|
+
}),
|
|
78
|
+
/* @__PURE__ */ jsx("hbr", {}),
|
|
79
|
+
/* @__PURE__ */ jsx(SingleLineComment, {
|
|
80
|
+
variant: "markdown",
|
|
81
|
+
children: code`NOTE: Do not edit this file manually - it will be overwritten automatically by the "prepare" command`
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ jsx("hbr", {})
|
|
84
|
+
] });
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
//#endregion
|
|
88
|
+
export { MarkdownFile };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_markdown_table = require('../contexts/markdown-table.cjs');
|
|
3
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
4
|
+
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
7
|
+
|
|
8
|
+
//#region ../plugin-alloy/src/markdown/components/markdown-table.tsx
|
|
9
|
+
/**
|
|
10
|
+
* Component that provides a context for rendering markdown tables.
|
|
11
|
+
*/
|
|
12
|
+
function MarkdownTable(props) {
|
|
13
|
+
const [{ children, data }] = (0, __alloy_js_core.splitProps)(props, ["children", "data"]);
|
|
14
|
+
const columns = (0, __alloy_js_core.computed)(() => Object.keys(data).map((name, index) => ({
|
|
15
|
+
index,
|
|
16
|
+
name,
|
|
17
|
+
align: "left",
|
|
18
|
+
width: 20
|
|
19
|
+
})));
|
|
20
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_markdown_table.MarkdownTableContext.Provider, {
|
|
21
|
+
value: {
|
|
22
|
+
columns: columns.value,
|
|
23
|
+
data
|
|
24
|
+
},
|
|
25
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
26
|
+
when: Boolean(children),
|
|
27
|
+
children
|
|
28
|
+
})
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
exports.MarkdownTable = MarkdownTable;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { MarkdownTableContext } from "../contexts/markdown-table.mjs";
|
|
2
|
+
import { Prose, Show, code, computed, splitProps } from "@alloy-js/core";
|
|
3
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
4
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
6
|
+
|
|
7
|
+
//#region ../plugin-alloy/src/markdown/components/markdown-table.tsx
|
|
8
|
+
/**
|
|
9
|
+
* Component that provides a context for rendering markdown tables.
|
|
10
|
+
*/
|
|
11
|
+
function MarkdownTable(props) {
|
|
12
|
+
const [{ children, data }] = splitProps(props, ["children", "data"]);
|
|
13
|
+
const columns = computed(() => Object.keys(data).map((name, index) => ({
|
|
14
|
+
index,
|
|
15
|
+
name,
|
|
16
|
+
align: "left",
|
|
17
|
+
width: 20
|
|
18
|
+
})));
|
|
19
|
+
return /* @__PURE__ */ jsx(MarkdownTableContext.Provider, {
|
|
20
|
+
value: {
|
|
21
|
+
columns: columns.value,
|
|
22
|
+
data
|
|
23
|
+
},
|
|
24
|
+
children: /* @__PURE__ */ jsx(Show, {
|
|
25
|
+
when: Boolean(children),
|
|
26
|
+
children
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
export { MarkdownTable };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
3
|
+
|
|
4
|
+
//#region ../plugin-alloy/src/markdown/contexts/markdown-table.ts
|
|
5
|
+
/**
|
|
6
|
+
* The Powerlines context used in template rendering.
|
|
7
|
+
*/
|
|
8
|
+
const MarkdownTableColumnContext = (0, __alloy_js_core.createNamedContext)("markdown-table-column", {});
|
|
9
|
+
/**
|
|
10
|
+
* The Powerlines context used in template rendering.
|
|
11
|
+
*/
|
|
12
|
+
const MarkdownTableContext = (0, __alloy_js_core.createContext)({
|
|
13
|
+
columns: [],
|
|
14
|
+
data: []
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.MarkdownTableContext = MarkdownTableContext;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { createContext, createNamedContext, useContext } from "@alloy-js/core";
|
|
2
|
+
|
|
3
|
+
//#region ../plugin-alloy/src/markdown/contexts/markdown-table.ts
|
|
4
|
+
/**
|
|
5
|
+
* The Powerlines context used in template rendering.
|
|
6
|
+
*/
|
|
7
|
+
const MarkdownTableColumnContext = createNamedContext("markdown-table-column", {});
|
|
8
|
+
/**
|
|
9
|
+
* The Powerlines context used in template rendering.
|
|
10
|
+
*/
|
|
11
|
+
const MarkdownTableContext = createContext({
|
|
12
|
+
columns: [],
|
|
13
|
+
data: []
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
17
|
+
export { MarkdownTableContext };
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_context = require('../../core/contexts/context.cjs');
|
|
3
|
+
const require_tsdoc = require('./tsdoc.cjs');
|
|
4
|
+
const require_typescript_file = require('./typescript-file.cjs');
|
|
5
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
6
|
+
let __stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
7
|
+
let __stryke_path_replace = require("@stryke/path/replace");
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
let __stryke_type_checks_is_set = require("@stryke/type-checks/is-set");
|
|
10
|
+
|
|
11
|
+
//#region ../plugin-alloy/src/typescript/components/builtin-file.tsx
|
|
12
|
+
/**
|
|
13
|
+
* A base component representing a Powerlines generated Typescript source file.
|
|
14
|
+
*
|
|
15
|
+
* @param props - The properties for the source file.
|
|
16
|
+
* @returns The rendered source file component.
|
|
17
|
+
*/
|
|
18
|
+
function BuiltinFile(props) {
|
|
19
|
+
const [{ children, imports, builtinImports, id, description, tsx }, rest] = (0, __alloy_js_core.splitProps)(props, [
|
|
20
|
+
"children",
|
|
21
|
+
"imports",
|
|
22
|
+
"builtinImports",
|
|
23
|
+
"id",
|
|
24
|
+
"description",
|
|
25
|
+
"tsx"
|
|
26
|
+
]);
|
|
27
|
+
const context = require_context.usePowerlinesSafe();
|
|
28
|
+
const path = (0, __alloy_js_core.computed)(() => (0, __stryke_path_replace.replacePath)(`${!(0, __stryke_type_checks_is_set.isSet)(tsx) ? id : (0, __stryke_path_replace.replaceExtension)(id)}${(0, __stryke_path_file_path_fns.hasFileExtension)(id) && !(0, __stryke_type_checks_is_set.isSet)(tsx) ? "" : tsx ? ".tsx" : ".ts"}`, context?.builtinsPath));
|
|
29
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_typescript_file.TypescriptFile, {
|
|
30
|
+
header: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_typescript_file.TypescriptFileHeader, {
|
|
31
|
+
header: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocModule, {
|
|
32
|
+
name: id,
|
|
33
|
+
children: description
|
|
34
|
+
}),
|
|
35
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_typescript_file.TypescriptFileHeaderImports, {
|
|
36
|
+
imports,
|
|
37
|
+
builtinImports
|
|
38
|
+
})
|
|
39
|
+
}),
|
|
40
|
+
meta: {
|
|
41
|
+
kind: "builtin",
|
|
42
|
+
extension: tsx ? "tsx" : "ts",
|
|
43
|
+
id: (0, __stryke_path_replace.replaceExtension)(id)
|
|
44
|
+
},
|
|
45
|
+
...rest,
|
|
46
|
+
path: path.value,
|
|
47
|
+
children
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
exports.BuiltinFile = BuiltinFile;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { usePowerlinesSafe } from "../../core/contexts/context.mjs";
|
|
2
|
+
import { TSDocModule } from "./tsdoc.mjs";
|
|
3
|
+
import { TypescriptFile, TypescriptFileHeader, TypescriptFileHeaderImports } from "./typescript-file.mjs";
|
|
4
|
+
import { computed, splitProps } from "@alloy-js/core";
|
|
5
|
+
import { hasFileExtension } from "@stryke/path/file-path-fns";
|
|
6
|
+
import { replaceExtension, replacePath } from "@stryke/path/replace";
|
|
7
|
+
import { jsx } from "react/jsx-runtime";
|
|
8
|
+
import { isSet } from "@stryke/type-checks/is-set";
|
|
9
|
+
|
|
10
|
+
//#region ../plugin-alloy/src/typescript/components/builtin-file.tsx
|
|
11
|
+
/**
|
|
12
|
+
* A base component representing a Powerlines generated Typescript source file.
|
|
13
|
+
*
|
|
14
|
+
* @param props - The properties for the source file.
|
|
15
|
+
* @returns The rendered source file component.
|
|
16
|
+
*/
|
|
17
|
+
function BuiltinFile(props) {
|
|
18
|
+
const [{ children, imports, builtinImports, id, description, tsx }, rest] = splitProps(props, [
|
|
19
|
+
"children",
|
|
20
|
+
"imports",
|
|
21
|
+
"builtinImports",
|
|
22
|
+
"id",
|
|
23
|
+
"description",
|
|
24
|
+
"tsx"
|
|
25
|
+
]);
|
|
26
|
+
const context = usePowerlinesSafe();
|
|
27
|
+
const path = computed(() => replacePath(`${!isSet(tsx) ? id : replaceExtension(id)}${hasFileExtension(id) && !isSet(tsx) ? "" : tsx ? ".tsx" : ".ts"}`, context?.builtinsPath));
|
|
28
|
+
return /* @__PURE__ */ jsx(TypescriptFile, {
|
|
29
|
+
header: /* @__PURE__ */ jsx(TypescriptFileHeader, {
|
|
30
|
+
header: /* @__PURE__ */ jsx(TSDocModule, {
|
|
31
|
+
name: id,
|
|
32
|
+
children: description
|
|
33
|
+
}),
|
|
34
|
+
children: /* @__PURE__ */ jsx(TypescriptFileHeaderImports, {
|
|
35
|
+
imports,
|
|
36
|
+
builtinImports
|
|
37
|
+
})
|
|
38
|
+
}),
|
|
39
|
+
meta: {
|
|
40
|
+
kind: "builtin",
|
|
41
|
+
extension: tsx ? "tsx" : "ts",
|
|
42
|
+
id: replaceExtension(id)
|
|
43
|
+
},
|
|
44
|
+
...rest,
|
|
45
|
+
path: path.value,
|
|
46
|
+
children
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
export { BuiltinFile };
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('../../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_reflection = require('../../core/contexts/reflection.cjs');
|
|
3
|
+
const require_tsdoc = require('./tsdoc.cjs');
|
|
4
|
+
let __alloy_js_core = require("@alloy-js/core");
|
|
5
|
+
let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
|
|
6
|
+
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
7
|
+
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
let __stryke_type_checks_is_undefined = require("@stryke/type-checks/is-undefined");
|
|
10
|
+
|
|
11
|
+
//#region ../plugin-alloy/src/typescript/components/tsdoc-reflection.tsx
|
|
12
|
+
/**
|
|
13
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
14
|
+
*/
|
|
15
|
+
function TSDocReflectionClass(props) {
|
|
16
|
+
const [{ children, heading }, rest] = (0, __alloy_js_core.splitProps)(props, ["heading", "children"]);
|
|
17
|
+
const reflectionClass = require_reflection.useReflectionClass();
|
|
18
|
+
const title = (0, __alloy_js_core.computed)(() => reflectionClass.reflection.getTitle() || (0, __stryke_string_format_title_case.titleCase)(reflectionClass.reflection.getName()));
|
|
19
|
+
const computedHeading = (0, __alloy_js_core.computed)(() => heading || reflectionClass.reflection.getDescription() || title.value);
|
|
20
|
+
const alias = (0, __alloy_js_core.computed)(() => reflectionClass.reflection.getAlias());
|
|
21
|
+
const domain = (0, __alloy_js_core.computed)(() => reflectionClass.reflection.getDomain());
|
|
22
|
+
const permission = (0, __alloy_js_core.computed)(() => reflectionClass.reflection.getPermission());
|
|
23
|
+
const readonly = (0, __alloy_js_core.computed)(() => reflectionClass.reflection.isReadonly());
|
|
24
|
+
const internal = (0, __alloy_js_core.computed)(() => reflectionClass.reflection.isInternal());
|
|
25
|
+
const ignore = (0, __alloy_js_core.computed)(() => reflectionClass.reflection.isIgnored());
|
|
26
|
+
const hidden = (0, __alloy_js_core.computed)(() => reflectionClass.reflection.isHidden());
|
|
27
|
+
if (!computedHeading.value || (0, __stryke_type_checks_is_set_string.isSetString)(computedHeading.value) && computedHeading.value.trim() === "") return null;
|
|
28
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_tsdoc.TSDoc, {
|
|
29
|
+
...rest,
|
|
30
|
+
heading: (0, __stryke_type_checks_is_set_string.isSetString)(computedHeading.value) ? computedHeading.value.trim() : computedHeading.value,
|
|
31
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
32
|
+
when: (0, __stryke_type_checks_is_set_string.isSetString)(title.value) || !(0, __stryke_type_checks_is_undefined.isUndefined)(alias.value) && alias.value.length > 0 || !(0, __stryke_type_checks_is_undefined.isUndefined)(permission.value) && permission.value.length > 0 || (0, __stryke_type_checks_is_set_string.isSetString)(domain.value) || !(0, __stryke_type_checks_is_undefined.isUndefined)(readonly.value) || !(0, __stryke_type_checks_is_undefined.isUndefined)(internal.value) || !(0, __stryke_type_checks_is_undefined.isUndefined)(ignore.value) || !(0, __stryke_type_checks_is_undefined.isUndefined)(hidden.value),
|
|
33
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocAttributesTags, {
|
|
34
|
+
title: title.value,
|
|
35
|
+
alias: alias.value,
|
|
36
|
+
domain: domain.value,
|
|
37
|
+
permission: permission.value,
|
|
38
|
+
readonly: readonly.value,
|
|
39
|
+
internal: internal.value,
|
|
40
|
+
ignore: ignore.value,
|
|
41
|
+
hidden: hidden.value
|
|
42
|
+
})
|
|
43
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
44
|
+
when: Boolean(children) && (0, __alloy_js_core.childrenArray)(() => children).length > 0,
|
|
45
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.List, { children: (0, __alloy_js_core.childrenArray)(() => children) })
|
|
46
|
+
})]
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
51
|
+
*/
|
|
52
|
+
function TSDocReflectionProperty(props) {
|
|
53
|
+
const [{ children }, rest] = (0, __alloy_js_core.splitProps)(props, ["children"]);
|
|
54
|
+
const context = require_reflection.useReflectionProperty();
|
|
55
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_tsdoc.TSDoc, {
|
|
56
|
+
heading: context.getDescription(),
|
|
57
|
+
...rest,
|
|
58
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_tsdoc.TSDocAttributesTags, {
|
|
59
|
+
type: context,
|
|
60
|
+
title: context.getTitle(),
|
|
61
|
+
alias: context.getAlias(),
|
|
62
|
+
domain: context.getDomain(),
|
|
63
|
+
permission: context.getPermission(),
|
|
64
|
+
readonly: context.isReadonly(),
|
|
65
|
+
internal: context.isInternal(),
|
|
66
|
+
ignore: context.isIgnored(),
|
|
67
|
+
hidden: context.isHidden(),
|
|
68
|
+
defaultValue: context.getDefaultValue()
|
|
69
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.Show, {
|
|
70
|
+
when: Boolean(children) && (0, __alloy_js_core.childrenArray)(() => children).length > 0,
|
|
71
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__alloy_js_core.List, { children: (0, __alloy_js_core.childrenArray)(() => children) })
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//#endregion
|
|
77
|
+
exports.TSDocReflectionClass = TSDocReflectionClass;
|
|
78
|
+
exports.TSDocReflectionProperty = TSDocReflectionProperty;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { useReflectionClass, useReflectionProperty } from "../../core/contexts/reflection.mjs";
|
|
2
|
+
import { TSDoc, TSDocAttributesTags } from "./tsdoc.mjs";
|
|
3
|
+
import { List, Show, childrenArray, code, computed, splitProps } from "@alloy-js/core";
|
|
4
|
+
import { isSetString } from "@stryke/type-checks/is-set-string";
|
|
5
|
+
import { titleCase } from "@stryke/string-format/title-case";
|
|
6
|
+
import { isString } from "@stryke/type-checks/is-string";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { isUndefined } from "@stryke/type-checks/is-undefined";
|
|
9
|
+
|
|
10
|
+
//#region ../plugin-alloy/src/typescript/components/tsdoc-reflection.tsx
|
|
11
|
+
/**
|
|
12
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
13
|
+
*/
|
|
14
|
+
function TSDocReflectionClass(props) {
|
|
15
|
+
const [{ children, heading }, rest] = splitProps(props, ["heading", "children"]);
|
|
16
|
+
const reflectionClass = useReflectionClass();
|
|
17
|
+
const title = computed(() => reflectionClass.reflection.getTitle() || titleCase(reflectionClass.reflection.getName()));
|
|
18
|
+
const computedHeading = computed(() => heading || reflectionClass.reflection.getDescription() || title.value);
|
|
19
|
+
const alias = computed(() => reflectionClass.reflection.getAlias());
|
|
20
|
+
const domain = computed(() => reflectionClass.reflection.getDomain());
|
|
21
|
+
const permission = computed(() => reflectionClass.reflection.getPermission());
|
|
22
|
+
const readonly = computed(() => reflectionClass.reflection.isReadonly());
|
|
23
|
+
const internal = computed(() => reflectionClass.reflection.isInternal());
|
|
24
|
+
const ignore = computed(() => reflectionClass.reflection.isIgnored());
|
|
25
|
+
const hidden = computed(() => reflectionClass.reflection.isHidden());
|
|
26
|
+
if (!computedHeading.value || isSetString(computedHeading.value) && computedHeading.value.trim() === "") return null;
|
|
27
|
+
return /* @__PURE__ */ jsxs(TSDoc, {
|
|
28
|
+
...rest,
|
|
29
|
+
heading: isSetString(computedHeading.value) ? computedHeading.value.trim() : computedHeading.value,
|
|
30
|
+
children: [/* @__PURE__ */ jsx(Show, {
|
|
31
|
+
when: isSetString(title.value) || !isUndefined(alias.value) && alias.value.length > 0 || !isUndefined(permission.value) && permission.value.length > 0 || isSetString(domain.value) || !isUndefined(readonly.value) || !isUndefined(internal.value) || !isUndefined(ignore.value) || !isUndefined(hidden.value),
|
|
32
|
+
children: /* @__PURE__ */ jsx(TSDocAttributesTags, {
|
|
33
|
+
title: title.value,
|
|
34
|
+
alias: alias.value,
|
|
35
|
+
domain: domain.value,
|
|
36
|
+
permission: permission.value,
|
|
37
|
+
readonly: readonly.value,
|
|
38
|
+
internal: internal.value,
|
|
39
|
+
ignore: ignore.value,
|
|
40
|
+
hidden: hidden.value
|
|
41
|
+
})
|
|
42
|
+
}), /* @__PURE__ */ jsx(Show, {
|
|
43
|
+
when: Boolean(children) && childrenArray(() => children).length > 0,
|
|
44
|
+
children: /* @__PURE__ */ jsx(List, { children: childrenArray(() => children) })
|
|
45
|
+
})]
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Generates a TypeScript interface property for the given reflection class.
|
|
50
|
+
*/
|
|
51
|
+
function TSDocReflectionProperty(props) {
|
|
52
|
+
const [{ children }, rest] = splitProps(props, ["children"]);
|
|
53
|
+
const context = useReflectionProperty();
|
|
54
|
+
return /* @__PURE__ */ jsxs(TSDoc, {
|
|
55
|
+
heading: context.getDescription(),
|
|
56
|
+
...rest,
|
|
57
|
+
children: [/* @__PURE__ */ jsx(TSDocAttributesTags, {
|
|
58
|
+
type: context,
|
|
59
|
+
title: context.getTitle(),
|
|
60
|
+
alias: context.getAlias(),
|
|
61
|
+
domain: context.getDomain(),
|
|
62
|
+
permission: context.getPermission(),
|
|
63
|
+
readonly: context.isReadonly(),
|
|
64
|
+
internal: context.isInternal(),
|
|
65
|
+
ignore: context.isIgnored(),
|
|
66
|
+
hidden: context.isHidden(),
|
|
67
|
+
defaultValue: context.getDefaultValue()
|
|
68
|
+
}), /* @__PURE__ */ jsx(Show, {
|
|
69
|
+
when: Boolean(children) && childrenArray(() => children).length > 0,
|
|
70
|
+
children: /* @__PURE__ */ jsx(List, { children: childrenArray(() => children) })
|
|
71
|
+
})]
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
//#endregion
|
|
76
|
+
export { TSDocReflectionClass, TSDocReflectionProperty };
|