@powerlines/plugin-alloy 0.26.216 → 0.26.218

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.
Files changed (101) hide show
  1. package/dist/core/components/infrastructure-file.d.mts.map +1 -1
  2. package/dist/core/components/infrastructure-file.mjs.map +1 -1
  3. package/dist/core/components/output.d.mts.map +1 -1
  4. package/dist/core/components/output.mjs.map +1 -1
  5. package/dist/core/components/single-line-comment.d.mts.map +1 -1
  6. package/dist/core/components/single-line-comment.mjs.map +1 -1
  7. package/dist/core/components/source-file.d.mts.map +1 -1
  8. package/dist/core/components/source-file.mjs.map +1 -1
  9. package/dist/core/components/spacing.d.mts.map +1 -1
  10. package/dist/core/components/spacing.mjs.map +1 -1
  11. package/dist/core/contexts/context.d.mts.map +1 -1
  12. package/dist/core/contexts/context.mjs.map +1 -1
  13. package/dist/core/contexts/meta.d.mts.map +1 -1
  14. package/dist/core/contexts/meta.mjs.map +1 -1
  15. package/dist/core/contexts/schema.d.mts.map +1 -1
  16. package/dist/core/contexts/schema.mjs.map +1 -1
  17. package/dist/core/helpers/code.d.mts.map +1 -1
  18. package/dist/core/helpers/code.mjs.map +1 -1
  19. package/dist/hcl/components/block-declaration.d.mts.map +1 -1
  20. package/dist/hcl/components/block-declaration.mjs.map +1 -1
  21. package/dist/hcl/components/hcl-file.d.mts.map +1 -1
  22. package/dist/hcl/components/hcl-file.mjs.map +1 -1
  23. package/dist/hcl/components/packer-file.d.mts.map +1 -1
  24. package/dist/hcl/components/packer-file.mjs.map +1 -1
  25. package/dist/hcl/components/terraform-file.d.mts.map +1 -1
  26. package/dist/hcl/components/terraform-file.mjs.map +1 -1
  27. package/dist/helpers/capnp.d.mts.map +1 -1
  28. package/dist/helpers/capnp.mjs.map +1 -1
  29. package/dist/helpers/create-builtin.d.mts.map +1 -1
  30. package/dist/helpers/create-builtin.mjs.map +1 -1
  31. package/dist/helpers/refkey.d.mts.map +1 -1
  32. package/dist/helpers/refkey.mjs.map +1 -1
  33. package/dist/helpers/typescript.d.mts.map +1 -1
  34. package/dist/helpers/typescript.mjs.map +1 -1
  35. package/dist/index.d.mts.map +1 -1
  36. package/dist/index.mjs.map +1 -1
  37. package/dist/markdown/components/front-matter.cjs +3 -1
  38. package/dist/markdown/components/front-matter.d.cts.map +1 -1
  39. package/dist/markdown/components/front-matter.d.mts.map +1 -1
  40. package/dist/markdown/components/front-matter.mjs +3 -1
  41. package/dist/markdown/components/front-matter.mjs.map +1 -1
  42. package/dist/markdown/components/heading.d.mts.map +1 -1
  43. package/dist/markdown/components/heading.mjs.map +1 -1
  44. package/dist/markdown/components/markdown-file.cjs +14 -2
  45. package/dist/markdown/components/markdown-file.d.mts.map +1 -1
  46. package/dist/markdown/components/markdown-file.mjs +14 -2
  47. package/dist/markdown/components/markdown-file.mjs.map +1 -1
  48. package/dist/markdown/components/markdown-table.d.mts.map +1 -1
  49. package/dist/markdown/components/markdown-table.mjs.map +1 -1
  50. package/dist/markdown/contexts/markdown-table.d.mts.map +1 -1
  51. package/dist/markdown/contexts/markdown-table.mjs.map +1 -1
  52. package/dist/render.d.mts.map +1 -1
  53. package/dist/render.mjs.map +1 -1
  54. package/dist/types/components.d.cts +12 -0
  55. package/dist/types/components.d.cts.map +1 -1
  56. package/dist/types/components.d.mts +12 -0
  57. package/dist/types/components.d.mts.map +1 -1
  58. package/dist/types/components.mjs.map +1 -1
  59. package/dist/types/plugin.d.mts.map +1 -1
  60. package/dist/typescript/components/builtin-file.d.mts.map +1 -1
  61. package/dist/typescript/components/builtin-file.mjs.map +1 -1
  62. package/dist/typescript/components/class-declaration.d.mts.map +1 -1
  63. package/dist/typescript/components/class-declaration.mjs.map +1 -1
  64. package/dist/typescript/components/dynamic-import-statement.d.mts.map +1 -1
  65. package/dist/typescript/components/dynamic-import-statement.mjs.map +1 -1
  66. package/dist/typescript/components/entry-file.d.mts.map +1 -1
  67. package/dist/typescript/components/entry-file.mjs.map +1 -1
  68. package/dist/typescript/components/interface-declaration.d.mts.map +1 -1
  69. package/dist/typescript/components/interface-declaration.mjs.map +1 -1
  70. package/dist/typescript/components/object-declaration.d.mts.map +1 -1
  71. package/dist/typescript/components/object-declaration.mjs.map +1 -1
  72. package/dist/typescript/components/property-name.d.mts.map +1 -1
  73. package/dist/typescript/components/property-name.mjs.map +1 -1
  74. package/dist/typescript/components/record-expression.d.mts.map +1 -1
  75. package/dist/typescript/components/record-expression.mjs.map +1 -1
  76. package/dist/typescript/components/tsdoc-schema.d.mts.map +1 -1
  77. package/dist/typescript/components/tsdoc-schema.mjs.map +1 -1
  78. package/dist/typescript/components/tsdoc.cjs +2 -12
  79. package/dist/typescript/components/tsdoc.d.mts.map +1 -1
  80. package/dist/typescript/components/tsdoc.mjs +2 -12
  81. package/dist/typescript/components/tsdoc.mjs.map +1 -1
  82. package/dist/typescript/components/type-declaration.d.mts.map +1 -1
  83. package/dist/typescript/components/type-declaration.mjs.map +1 -1
  84. package/dist/typescript/components/type-parameters.d.mts.map +1 -1
  85. package/dist/typescript/components/type-parameters.mjs.map +1 -1
  86. package/dist/typescript/components/typescript-file.cjs +13 -2
  87. package/dist/typescript/components/typescript-file.d.cts.map +1 -1
  88. package/dist/typescript/components/typescript-file.d.mts.map +1 -1
  89. package/dist/typescript/components/typescript-file.mjs +13 -2
  90. package/dist/typescript/components/typescript-file.mjs.map +1 -1
  91. package/dist/typescript/contexts/lexical-scope.d.mts.map +1 -1
  92. package/dist/typescript/contexts/lexical-scope.mjs.map +1 -1
  93. package/dist/typescript/contexts/member-scope.d.mts.map +1 -1
  94. package/dist/typescript/contexts/member-scope.mjs.map +1 -1
  95. package/dist/typescript/helpers/get-call-signature-props.d.mts.map +1 -1
  96. package/dist/typescript/helpers/get-call-signature-props.mjs.map +1 -1
  97. package/dist/typescript/helpers/utilities.d.mts.map +1 -1
  98. package/dist/typescript/helpers/utilities.mjs.map +1 -1
  99. package/dist/yaml/components/yaml-file.d.mts.map +1 -1
  100. package/dist/yaml/components/yaml-file.mjs.map +1 -1
  101. package/package.json +6 -6
@@ -76,7 +76,7 @@ function TypescriptFile(props) {
76
76
  * @returns The rendered source file header.
77
77
  */
78
78
  function TypescriptFileHeader(props) {
79
- const { header, hashbang, disableEslint = true, disableBiome = true, children } = props;
79
+ const { header, hashbang, disableEslint = true, disableBiome = true, disableOxlint = true, children } = props;
80
80
  const context = require_core_contexts_context.usePowerlinesSafe();
81
81
  return [
82
82
  (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
@@ -107,6 +107,17 @@ function TypescriptFileHeader(props) {
107
107
  }), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
108
108
  }
109
109
  }),
110
+ (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
111
+ get when() {
112
+ return Boolean(disableOxlint);
113
+ },
114
+ get children() {
115
+ return [(0, _alloy_js_core_jsx_runtime.createComponent)(require_core_components_single_line_comment.SingleLineComment, {
116
+ variant: "slash-star",
117
+ children: "oxlint-disable"
118
+ }), (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {})];
119
+ }
120
+ }),
110
121
  (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
111
122
  get when() {
112
123
  return Boolean(disableBiome);
@@ -117,7 +128,7 @@ function TypescriptFileHeader(props) {
117
128
  }),
118
129
  (0, _alloy_js_core_jsx_runtime.createComponent)(_alloy_js_core.Show, {
119
130
  get when() {
120
- return Boolean(disableEslint) || Boolean(disableBiome);
131
+ return Boolean(disableEslint) || Boolean(disableBiome) || Boolean(disableOxlint);
121
132
  },
122
133
  get children() {
123
134
  return (0, _alloy_js_core_jsx_runtime.createIntrinsic)("hbr", {});
@@ -1 +1 @@
1
- {"version":3,"file":"typescript-file.d.cts","names":[],"sources":["../../../src/typescript/components/typescript-file.tsx"],"mappings":";;;;;;KAsDY,mBAAA,GAAsB,IAAA,CAAK,iBAAA,gBACrC,cAAA;EACE,QAAA,GAAW,QAAA;EACX,MAAA,GAAS,QAAA;EACT,OAAA,GAAU,qBAAA;EACV,cAAA,GAAiB,qBAAA;EACjB,MAAA;EACA,GAAA;AAAA;;;;;;;iBASY,cAAA,CAAe,KAAA,EAAO,mBAAA,GAAmB,QAAA;AAAA,UAgExC,yBAAA,SAAkC,qBAAA;EACjD,MAAA,GAAS,QAAA;EACT,QAAA,GAAW,QAAA;AAAA;;;;;;;iBASG,oBAAA,CAAqB,KAAA,EAAO,yBAAA,GAAyB,QAAA;AAAA,UAuDpD,gCAAA,SAAyC,qBAAA;EACxD,OAAA,GAAU,qBAAA;EACV,cAAA,GAAiB,qBAAA;EACjB,KAAA,GAAQ,aAAA;AAAA;;;;;;;iBASM,2BAAA,CACd,KAAA,EAAO,gCAAA,GAAgC,QAAA"}
1
+ {"version":3,"file":"typescript-file.d.cts","names":[],"sources":["../../../src/typescript/components/typescript-file.tsx"],"mappings":";;;;;;KAsDY,mBAAA,GAAsB,IAAA,CAAK,iBAAA,gBACrC,cAAA;EACE,QAAA,GAAW,QAAA;EACX,MAAA,GAAS,QAAA;EACT,OAAA,GAAU,qBAAA;EACV,cAAA,GAAiB,qBAAA;EACjB,MAAA;EACA,GAAA;AAAA;;;;;;;iBASY,cAAA,CAAe,KAAA,EAAO,mBAAA,GAAmB,QAAA;AAAA,UAgExC,yBAAA,SAAkC,qBAAA;EACjD,MAAA,GAAS,QAAA;EACT,QAAA,GAAW,QAAA;AAAA;;;;;;;iBASG,oBAAA,CAAqB,KAAA,EAAO,yBAAA,GAAyB,QAAA;AAAA,UAmEpD,gCAAA,SAAyC,qBAAA;EACxD,OAAA,GAAU,qBAAA;EACV,cAAA,GAAiB,qBAAA;EACjB,KAAA,GAAQ,aAAA;AAAA;;;;;;;iBASM,2BAAA,CACd,KAAA,EAAO,gCAAA,GAAgC,QAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"typescript-file.d.mts","names":[],"sources":["../../../src/typescript/components/typescript-file.tsx"],"mappings":";;;;;;KAsDY,mBAAA,GAAsB,IAAA,CAAK,iBAAA,gBACrC,cAAA;EACE,QAAA,GAAW,QAAA;EACX,MAAA,GAAS,QAAA;EACT,OAAA,GAAU,qBAAA;EACV,cAAA,GAAiB,qBAAA;EACjB,MAAA;EACA,GAAA;AAAA;;;;;;;iBASY,cAAA,CAAe,KAAA,EAAO,mBAAA,GAAmB,QAAA;AAAA,UAgExC,yBAAA,SAAkC,qBAAA;EACjD,MAAA,GAAS,QAAA;EACT,QAAA,GAAW,QAAA;AAAA;;;;;;;iBASG,oBAAA,CAAqB,KAAA,EAAO,yBAAA,GAAyB,QAAA;AAAA,UAuDpD,gCAAA,SAAyC,qBAAA;EACxD,OAAA,GAAU,qBAAA;EACV,cAAA,GAAiB,qBAAA;EACjB,KAAA,GAAQ,aAAA;AAAA;;;;;;;iBASM,2BAAA,CACd,KAAA,EAAO,gCAAA,GAAgC,QAAA"}
1
+ {"version":3,"file":"typescript-file.d.mts","names":[],"sources":["../../../src/typescript/components/typescript-file.tsx"],"mappings":""}
@@ -75,7 +75,7 @@ function TypescriptFile(props) {
75
75
  * @returns The rendered source file header.
76
76
  */
77
77
  function TypescriptFileHeader(props) {
78
- const { header, hashbang, disableEslint = true, disableBiome = true, children } = props;
78
+ const { header, hashbang, disableEslint = true, disableBiome = true, disableOxlint = true, children } = props;
79
79
  const context = usePowerlinesSafe();
80
80
  return [
81
81
  createComponent(Show, {
@@ -106,6 +106,17 @@ function TypescriptFileHeader(props) {
106
106
  }), createIntrinsic("hbr", {})];
107
107
  }
108
108
  }),
109
+ createComponent(Show, {
110
+ get when() {
111
+ return Boolean(disableOxlint);
112
+ },
113
+ get children() {
114
+ return [createComponent(SingleLineComment, {
115
+ variant: "slash-star",
116
+ children: "oxlint-disable"
117
+ }), createIntrinsic("hbr", {})];
118
+ }
119
+ }),
109
120
  createComponent(Show, {
110
121
  get when() {
111
122
  return Boolean(disableBiome);
@@ -116,7 +127,7 @@ function TypescriptFileHeader(props) {
116
127
  }),
117
128
  createComponent(Show, {
118
129
  get when() {
119
- return Boolean(disableEslint) || Boolean(disableBiome);
130
+ return Boolean(disableEslint) || Boolean(disableBiome) || Boolean(disableOxlint);
120
131
  },
121
132
  get children() {
122
133
  return createIntrinsic("hbr", {});
@@ -1 +1 @@
1
- {"version":3,"file":"typescript-file.mjs","names":[],"sources":["../../../src/typescript/components/typescript-file.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Children } from \"@alloy-js/core\";\nimport {\n computed,\n For,\n Scope,\n Show,\n SourceDirectoryContext,\n splitProps,\n useContext,\n useScope\n} from \"@alloy-js/core\";\nimport {\n getSourceDirectoryData,\n ImportStatements,\n PackageContext,\n SourceFileContext,\n TSModuleScope,\n useSourceFile\n} from \"@alloy-js/typescript\";\nimport { getUniqueBy } from \"@stryke/helpers/get-unique\";\nimport { appendPath } from \"@stryke/path/append\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isBoolean } from \"@stryke/type-checks/is-boolean\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { code } from \"../../core/helpers/code\";\nimport {\n ComponentProps,\n SourceFileHeaderProps,\n TypescriptFileImportItem,\n TypescriptFileImports\n} from \"../../types/components\";\n\nexport type TypescriptFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps & {\n hashbang?: Children | true;\n header?: Children;\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n export?: boolean | string;\n tsx?: boolean;\n };\n\n/**\n * A base component representing a Powerlines generated Typescript source file.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function TypescriptFile(props: TypescriptFileProps) {\n const [\n { children, path, imports, builtinImports, tsx, header, hashbang },\n rest\n ] = splitProps(props, [\n \"children\",\n \"path\",\n \"imports\",\n \"builtinImports\",\n \"tsx\",\n \"header\",\n \"hashbang\"\n ]);\n\n const directoryContext = useContext(SourceDirectoryContext)!;\n const sdData = getSourceDirectoryData(directoryContext);\n\n const modulePath = appendPath(path, directoryContext.path);\n const scope = new TSModuleScope(modulePath, useScope());\n sdData.modules.add(scope);\n\n const pkg = useContext(PackageContext);\n if (pkg) {\n pkg.scope.addModule(scope);\n }\n\n if (props.export) {\n if (pkg) {\n if (isBoolean(props.export)) {\n pkg.scope.addExport(modulePath, scope);\n } else {\n pkg.scope.addExport(props.export, scope);\n }\n }\n }\n\n return (\n <SourceFileContext.Provider\n value={{\n scope\n }}>\n <Scope value={scope}>\n <SourceFile\n {...rest}\n path={modulePath}\n header={\n header ?? (\n <TypescriptFileHeader hashbang={hashbang}>\n <TypescriptFileHeaderImports\n imports={imports}\n builtinImports={builtinImports}\n scope={scope}\n />\n </TypescriptFileHeader>\n )\n }\n filetype={tsx ? \"tsx\" : \"typescript\"}>\n {children}\n </SourceFile>\n </Scope>\n </SourceFileContext.Provider>\n );\n}\n\nexport interface TypescriptFileHeaderProps extends SourceFileHeaderProps {\n header?: Children;\n hashbang?: Children | true;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeader(props: TypescriptFileHeaderProps) {\n const {\n header,\n hashbang,\n disableEslint = true,\n disableBiome = true,\n children\n } = props;\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show when={Boolean(hashbang)}>\n {hashbang === true\n ? code`#!/usr/bin/env ${\n context?.config.mode === \"development\"\n ? \"-S NODE_OPTIONS=--enable-source-maps\"\n : \"\"\n } node`\n : hashbang}\n <hbr />\n </Show>\n <Show when={Boolean(header)}>\n {header}\n <hbr />\n </Show>\n <hbr />\n <Show when={Boolean(disableEslint)}>\n <SingleLineComment variant=\"slash-star\">\n {\"eslint-disable\"}\n </SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableBiome)}>\n <SingleLineComment>{\"biome-ignore lint: disable\"}</SingleLineComment>\n <hbr />\n </Show>\n <Show when={Boolean(disableEslint) || Boolean(disableBiome)}>\n <hbr />\n </Show>\n <Show when={Boolean(children)}>\n {children}\n <hbr />\n </Show>\n <SingleLineComment>{`Generated by ${\n titleCase(context?.config?.framework?.name) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment>{getFileHeaderWarning(context!)}</SingleLineComment>\n <hbr />\n </>\n );\n}\n\nexport interface TypescriptFileHeaderImportsProps extends SourceFileHeaderProps {\n imports?: TypescriptFileImports;\n builtinImports?: TypescriptFileImports;\n scope?: TSModuleScope;\n}\n\n/**\n * Renders the header for a Powerlines Typescript source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function TypescriptFileHeaderImports(\n props: TypescriptFileHeaderImportsProps\n) {\n const { imports: importProps, builtinImports: builtinImportsProps } = props;\n\n const context = usePowerlinesSafe();\n const sourceFile = useSourceFile();\n\n const scope = props.scope ?? sourceFile.scope;\n\n const imports = computed(() => {\n return Object.fromEntries(\n Object.entries(importProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n const builtinImports = computed(() => {\n return Object.fromEntries(\n Object.entries(builtinImportsProps ?? {}).map(([module, importItem]) => [\n module,\n Array.isArray(importItem)\n ? getUniqueBy(importItem, i => (isString(i) ? i : i.alias || i.name))\n : importItem\n ])\n );\n });\n\n return (\n <Show\n when={\n scope.importedModules.size > 0 ||\n (!!imports.value && Object.keys(imports.value).length > 0) ||\n (!!builtinImports.value && Object.keys(builtinImports.value).length > 0)\n }>\n <Show when={!!imports.value && Object.keys(imports.value).length > 0}>\n <For\n each={Object.entries(imports.value ?? {})}\n hardline\n ender={<hbr />}>\n {([module, importItem]) =>\n code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : `${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(\n i =>\n `${i.type ? \"type \" : \"\"}${\n i.alias ? i.alias : i.name\n }`\n )\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default).length >\n 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .filter(i => isString(i) || !i.default)\n .map(i =>\n isString(i)\n ? i\n : `${i.type ? \"type \" : \"\"}${\n i.alias ? `${i.name} as ${i.alias}` : i.name\n }`\n )\n .join(\", \")} }`\n : \"\")\n }`\n } from \"${module}\";`\n }\n </For>\n </Show>\n <Show\n when={\n builtinImports.value && Object.keys(builtinImports.value).length > 0\n }>\n <For\n each={Object.entries(\n (builtinImports.value ?? {}) as Record<\n string,\n null | Array<TypescriptFileImportItem | string>\n >\n )}\n hardline\n ender={<hbr />}>\n {([module, importItem]) =>\n code`import ${\n importItem === null\n ? \"\"\n : isString(importItem)\n ? importItem\n : `${\n (\n importItem.filter(\n i => !isString(i) && i.default\n ) as TypescriptFileImportItem[]\n )\n .map(\n i =>\n `${i.type ? \"type \" : \"\"}${\n i.alias ? i.alias : i.name\n }`\n )\n .join(\", \") +\n (importItem.filter(i => !isString(i) && i.default)\n .length > 0 &&\n importItem.filter(i => isString(i) || !i.default).length >\n 0\n ? \", \"\n : \"\") +\n (importItem.filter(i => isString(i) || !i.default)\n .length > 0\n ? `{ ${importItem\n .filter(i => isString(i) || !i.default)\n .map(i =>\n isString(i)\n ? i\n : `${i.type ? \"type \" : \"\"}${\n i.alias ? `${i.name} as ${i.alias}` : i.name\n }`\n )\n .join(\", \")} }`\n : \"\")\n }`\n } from \"${\n module.includes(\":\")\n ? module\n : `${context?.config?.framework?.name || \"powerlines\"}:${module}`\n }\";`\n }\n </For>\n </Show>\n <Show when={scope.importedModules.size > 0}>\n <ImportStatements records={scope.importedModules} />\n </Show>\n <hbr />\n </Show>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsCA,SAAS,eAAoB,OAAO;CACpC,MAAQ,CAAC,EACT,UACA,MACA,SACA,gBACA,KACA,QACA,YACA,QAAO,WAAA,OAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;CAAA,CAAA;CACL,MAAA,mBAAc,WAAA,sBAAA;CACd,MAAA,SAAA,uBAAqB,gBAAA;CACrB,MAAA,aAAA,WAAwB,MAAA,iBAAA,IAAA;CACxB,MAAA,QAAA,IAAA,cAAA,YAAA,SAAA,CAAA;CACA,OAAO,QAAK,IAAM,KAAA;;CAEpB,IAAM,KACJ,IAAA,MAAA,UAAiB,KAAA;CAEjB,IAAE,MAAQ,QACR;MAAA,KACA,IAAA,UAAgB,MAAC,MAAA,GACjB,IAAQ,MAAC,UAAU,YAAM,KAAA;OAE1B,IAAA,MAAA,UAAA,MAAA,QAAA,KAAA;CAED;CAED,OAAA,gBAAA,oBAAA,UAAA;EACG,OAAM,EACN,MACF;EACF,IAAO,WAAS;GACd,OAAM,gBAAA,OAAA;IACF,OAAS;IACX,IAAA,WAAA;KACE,OAAW,gBAAO,YAAA,WAAA,MAAA;MACnB,MAAS;MACJ,IAAA,SAAA;OACG,OAAA,UAAA,gBAAA,sBAAA;QACO;QACX,IAAA,WAAA;SACG,OAAA,gBAAA,6BAAA;UACC;UACT;;SAEI,CAAA;QACQ;;MAER;MACA,UAAY,MAAA,QAAc;MACb;;IAEb;GACF,CAAA;EACF;CACF,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OAAA,KAAA,SAAA,UAAA,IAAA,aAAA,GAAA,WAAA,QAAA,MAAA,CAAA,SAAA,CAAA,KAAA,EAAA,OAAA,EAAA,KAAA,MAAA,GAAA,EAAA,OAAA,UAAA,KAAA,EAAA,QAAA,EAAA,QAAA,EAAA,MAAA,EAAA,KAAA,IAAA,KAAA,WAAA,QAAA,MAAA,CAAA,SAAA,CAAA,KAAA,EAAA,OAAA,EAAA,SAAA,KAAA,WAAA,QAAA,MAAA,SAAA,CAAA,KAAA,CAAA,EAAA,OAAA,EAAA,SAAA,IAAA,OAAA,OAAA,WAAA,QAAA,MAAA,SAAA,CAAA,KAAA,CAAA,EAAA,OAAA,EAAA,SAAA,IAAA,KAAA,WAAA,QAAA,MAAA,SAAA,CAAA,KAAA,CAAA,EAAA,OAAA,EAAA,KAAA,MAAA,SAAA,CAAA,IAAA,IAAA,GAAA,EAAA,OAAA,UAAA,KAAA,EAAA,QAAA,GAAA,EAAA,KAAA,MAAA,EAAA,UAAA,EAAA,MAAA,EAAA,KAAA,IAAA,EAAA,MAAA,MAAA,SAAA,OAAA,SAAA,GAAA,IAAA,SAAA,GAAA,SAAA,QAAA,WAAA,QAAA,aAAA,GAAA,SAAA;MACvB,CAAC;KACL;IACA,CAAC;IAAC,gBAAM,MAAA;KACN,IAAA,OAAM;MACJ,OAAE,MAAW,gBAAgB,OAAG;KAClC;KACD,IAAA,WAAA;MACF,OAAA,gBAAA,kBAAA,EACD,IAAA,UAAA;OACI,OAAA,MAAiB;MACd,EACL,CAAA;KACE;IACF,CAAC;IAAC,gBAAc,OAAU,CAAA,CAAA;GAAA;EAC5B;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"typescript-file.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"lexical-scope.d.mts","names":[],"sources":["../../../src/typescript/contexts/lexical-scope.tsx"],"mappings":";;;UAqBiB,+BAAA,SAAwC,mBAAmB;AAAA,UAC3D,8BAAA,SAAuC,kBAAkB;AAAA,KAE9D,iBAAA,GACR,+BAAA,GACA,8BAA8B;;AAL0C;AAC5E;iBASgB,YAAA,CAAa,KAAA,EAAO,iBAAiB,4BAAA,QAAA"}
1
+ {"version":3,"file":"lexical-scope.d.mts","names":[],"sources":["../../../src/typescript/contexts/lexical-scope.tsx"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"lexical-scope.mjs","names":[],"sources":["../../../src/typescript/contexts/lexical-scope.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Scope, ScopePropsWithInfo, ScopePropsWithValue } from \"@alloy-js/core\";\nimport { createLexicalScope, TSLexicalScope } from \"@alloy-js/typescript\";\n\nexport interface LexicalScopePropsWithScopeValue extends ScopePropsWithValue {}\nexport interface LexicalScopePropsWithScopeInfo extends ScopePropsWithInfo {}\n\nexport type LexicalScopeProps =\n | LexicalScopePropsWithScopeValue\n | LexicalScopePropsWithScopeInfo;\n\n/**\n * A lexical scope for TypeScript, which contains declaration spaces for types and values. Declaration components will create symbols in this scope.\n */\nexport function LexicalScope(props: LexicalScopeProps) {\n let scope;\n if (\"value\" in props) {\n if (!(props.value instanceof TSLexicalScope)) {\n throw new TypeError(\n \"LexicalScope value must be a TSLexicalScope instance\"\n );\n }\n scope = props.value;\n } else {\n scope = createLexicalScope(props.name ?? \"Lexical scope\", props);\n }\n\n return <Scope value={scope}>{props.children}</Scope>;\n}\n"],"mappings":";;;;;;;;AAwBA,SAAY,aAAiB,OAAC;CAC5B,IAAE;CACF,IAAE,WAAA,OAAA;gDAEF,MAAA,IAAA,UAAA,sDAAA;EAEA,QAAA,MAAA;CACF,OACE,QAAS,mBAAA,MAAA,QAAA,iBAAA,KAAA;CAET,OAAO,gBAAa,OAAW;EAC7B,OAAO;EACP,IAAI,WAAC;GACH,OAAC,MAAA;EACH;CACF,CAAC;AACH"}
1
+ {"version":3,"file":"lexical-scope.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"member-scope.d.mts","names":[],"sources":["../../../src/typescript/contexts/member-scope.tsx"],"mappings":";;;;UA6BiB,gBAAA;EACf,QAAA,EAAU,QAAA;EADK;;;EAMf,WAAA,EAAa,cAAc;AAAA;;;;;iBAOb,WAAA,CAAY,KAAA,EAAO,gBAAA,GAAgB,QAAA"}
1
+ {"version":3,"file":"member-scope.d.mts","names":[],"sources":["../../../src/typescript/contexts/member-scope.tsx"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"member-scope.mjs","names":[],"sources":["../../../src/typescript/contexts/member-scope.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport {\n Children,\n MemberScope as CoreMemberScope,\n createScope\n} from \"@alloy-js/core\";\nimport {\n TSMemberScope,\n TSOutputSymbol,\n useTSLexicalScopeIfPresent\n} from \"@alloy-js/typescript\";\n\nexport interface MemberScopeProps {\n children: Children;\n\n /**\n * The symbol that this member scope will create member symbols on.\n */\n ownerSymbol: TSOutputSymbol;\n}\n\n/**\n * A member scope for TypeScript. Member declarations will create symbols\n * in this scope, which will be added to the owner symbol's members.\n */\nexport function MemberScope(props: MemberScopeProps) {\n const parentScope = useTSLexicalScopeIfPresent();\n const binder = props.ownerSymbol.binder ?? parentScope?.binder;\n const memberScope = createScope(\n TSMemberScope,\n \"member-scope\",\n parentScope,\n props.ownerSymbol,\n {\n binder\n }\n );\n\n return (\n <CoreMemberScope value={memberScope}>{props.children}</CoreMemberScope>\n );\n}\n"],"mappings":";;;;;;;;;AAyBA,SAAgB,YAAA,OAAA;CACd,MAAA,cAAA,2BAAA;CACA,MAAM,SAAS,MAAC,YAAW,UAAA,aAAA;;EAKzB,oFAHJ,OACE,CAEE;EACA,IAAI,WAAQ;GACZ,OAAA,MAAA;EACF;CACF,CAAA"}
1
+ {"version":3,"file":"member-scope.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"get-call-signature-props.d.mts","names":[],"sources":["../../../src/typescript/helpers/get-call-signature-props.ts"],"mappings":";;;;;AA4BA;;;;;iBAAgB,qBAAA,CACd,KAAA,EAAO,kBAAA,EACP,QAAA,GAAW,OAAA,CAAQ,kBAAA,IAAmB,kBAAA"}
1
+ {"version":3,"file":"get-call-signature-props.d.mts","names":[],"sources":["../../../src/typescript/helpers/get-call-signature-props.ts"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"get-call-signature-props.mjs","names":[],"sources":["../../../src/typescript/helpers/get-call-signature-props.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { defaultProps, splitProps } from \"@alloy-js/core\";\nimport { CallSignatureProps } from \"@alloy-js/typescript\";\n\n/**\n * Get the properties for a call signature, applying any defaults as necessary.\n *\n * @param props - The properties for the call signature.\n * @param defaults - Optional default properties to apply to the call signature.\n * @returns The properties for the call signature, with defaults applied as necessary.\n */\nexport function getCallSignatureProps(\n props: CallSignatureProps,\n defaults?: Partial<CallSignatureProps>\n) {\n const [callSignatureProps] = splitProps(props, [\n \"parameters\",\n \"parametersChildren\",\n \"typeParameters\",\n \"typeParametersChildren\",\n \"returnType\"\n ]);\n\n if (!defaults) {\n return callSignatureProps;\n }\n\n return defaultProps(callSignatureProps, defaults);\n}\n"],"mappings":";;;;;;;;;;AA4BA,SAAgB,sBAAqB,OAAA,UAAA;CACnC,MAAM,CAAC,sBAAkB,WAAA,OAAA;EAAA;EAAA;EAAA;EAAA;EAAA;CAAA,CAAA;CACzB,IAAA,CAAA,UACA,OAAA;CAEA,OAAG,aAAW,oBAAA,QAAA;AAChB"}
1
+ {"version":3,"file":"get-call-signature-props.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"utilities.d.mts","names":[],"sources":["../../../src/typescript/helpers/utilities.ts"],"mappings":";;AAwBA;;;;AAAsD;iBAAtC,mBAAA,CAAoB,UAAkB"}
1
+ {"version":3,"file":"utilities.d.mts","names":[],"sources":["../../../src/typescript/helpers/utilities.ts"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"utilities.mjs","names":[],"sources":["../../../src/typescript/helpers/utilities.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\n/**\n * Check if a string is a valid JavaScript identifier.\n *\n * @param identifier - The string to check.\n * @returns `true` if the string is a valid JavaScript identifier, `false` otherwise.\n */\nexport function isValidJSIdentifier(identifier: string) {\n return /^[\\p{ID_Start}$_][\\p{ID_Continue}$\\u200C\\u200D]*$/u.test(identifier);\n}\n"],"mappings":";;;;;;;AAwBA,SAAgB,oBAAoB,YAAY;CAC9C,OAAO,qDAAqD,KAAK,UAAU;AAC7E"}
1
+ {"version":3,"file":"utilities.mjs","names":[],"sources":[],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"yaml-file.d.mts","names":[],"sources":["../../../src/yaml/components/yaml-file.tsx"],"mappings":";;;;;UA4BiB,QAAA;EAAA,CACd,GAAA,uCAA0C,QAAA,GAAW,QAAQ;AAAA;AAAA,KAoDpD,aAAA,GAAgB,IAAA,CAAK,iBAAA,gBAC/B,cAAA;EACE,MAAA,GAAS,QAAA;EACT,IAAA,GAAO,QAAA;AAAA;;;;AAvDqD;AAoDhE;;;;;iBAegB,QAAA,CAAS,KAAA,EAAO,aAAA,GAAa,QAAA;;;;;;;iBAiC7B,cAAA,CAAe,KAAA,EAAO,qBAAA,GAAqB,QAAA"}
1
+ {"version":3,"file":"yaml-file.d.mts","names":[],"sources":["../../../src/yaml/components/yaml-file.tsx"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"file":"yaml-file.mjs","names":[],"sources":["../../../src/yaml/components/yaml-file.tsx"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Children } from \"@alloy-js/core\";\nimport { code, For, Show, splitProps } from \"@alloy-js/core\";\nimport { titleCase } from \"@stryke/string-format/title-case\";\nimport { isSetObject } from \"@stryke/type-checks\";\nimport { getFileHeaderWarning } from \"powerlines/utils\";\nimport { SingleLineComment } from \"../../core/components/single-line-comment\";\nimport { SourceFile, SourceFileProps } from \"../../core/components/source-file\";\nimport { usePowerlinesSafe } from \"../../core/contexts/context\";\nimport { ComponentProps, SourceFileHeaderProps } from \"../../types/components\";\n\nexport interface YamlData {\n [key: string]: string | number | boolean | YamlData | YamlData[];\n}\n\ninterface YamlFileDataItemProps {\n value: string | number | boolean | YamlData | YamlData[];\n key?: string;\n}\n\nfunction YamlFileDataItem({ key, value }: YamlFileDataItemProps) {\n return (\n <>\n <Show when={Boolean(key)}>{code`${key}:`}</Show>\n <Show\n when={\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\"\n }>\n {code` ${String(value)}`}\n </Show>\n <Show when={isSetObject(value) && !Array.isArray(value)}>\n <For each={Object.entries(value as YamlData)}>\n {([nestedKey, nestedValue]) => (\n <YamlFileDataItem key={nestedKey} value={nestedValue} />\n )}\n </For>\n </Show>\n <Show when={Array.isArray(value)}>\n <For each={value as YamlData[]}>\n {item => <YamlFileDataItem value={item} />}\n </For>\n </Show>\n </>\n );\n}\n\ninterface YamlFileDataProps {\n data?: YamlData;\n}\n\nfunction YamlFileData({ data }: YamlFileDataProps) {\n return (\n <>\n <Show when={Boolean(data)}>\n <For each={Object.entries(data ?? {})}>\n {([key, value]) => <YamlFileDataItem key={key} value={value} />}\n </For>\n </Show>\n </>\n );\n}\n\nexport type YamlFileProps = Omit<SourceFileProps, \"filetype\"> &\n ComponentProps & {\n header?: Children;\n data?: YamlData;\n };\n\n/**\n * A base component representing a Powerlines generated YAML source file.\n *\n * @remarks\n * The file content can be provided either through the `data` prop, which accepts a nested object representing the YAML structure, or through the `children` prop, which allows for custom YAML content to be rendered. The `header` prop can be used to provide custom header content for the YAML file, which is rendered above the generated file header warning and generation comment.\n *\n * @param props - The properties for the source file.\n * @returns The rendered source file component.\n */\nexport function YamlFile(props: YamlFileProps) {\n const [{ children, path, data, header }, rest] = splitProps(props, [\n \"children\",\n \"path\",\n \"data\",\n \"header\"\n ]);\n\n return (\n <SourceFile\n {...rest}\n path={path}\n header={<YamlFileHeader>{header}</YamlFileHeader>}\n filetype=\"yaml\">\n <Show when={Boolean(data)}>\n <YamlFileData data={data} />\n </Show>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n </SourceFile>\n );\n}\n\n/**\n * Renders the header for a Powerlines YAML source file.\n *\n * @param props - The properties for the source file header.\n * @returns The rendered source file header.\n */\nexport function YamlFileHeader(props: SourceFileHeaderProps) {\n const { children } = props;\n\n const context = usePowerlinesSafe();\n\n return (\n <>\n <Show when={Boolean(children)}>\n <>\n {children}\n <hbr />\n </>\n </Show>\n <SingleLineComment>{`Generated by ${\n titleCase(context?.config?.framework?.name) || \"Powerlines\"\n }`}</SingleLineComment>\n <hbr />\n <SingleLineComment variant=\"yaml\">\n {getFileHeaderWarning(context!)}\n </SingleLineComment>\n <hbr />\n </>\n );\n}\n"],"mappings":";;;;;;;;;;4BA4BA,KACE,SACF;;;GAEA,IAAA,OAAU;IACR,OAAO,QAAS,GAAM;GACtB;GACF,UAAA,IAAA,GAAA,IAAA;;;GAEA,MAAS,OAAA,UAAkB,YAAY,OAAG,UAAA,YAAuB,OAAA,UAAA;GAC/D,IAAM,WAAC;IACJ,OAAA,IAAA,KAAA,OAAA,KAAA;GACD;EACF,CAAC;EAAG,gBAAC,MAAA;GACH,IAAI,OAAK;IACP,OAAI,WAAgB,CAAC,CAAC,YAAS,KAAA,CAAA,EAAA,KAAA,CAAA,MAAA,QAAA,KAAA;GACjC;GACA,IAAI,WAAS;IACX,OAAG,gBAAA,KAAA;KACD,IAAC,OAAS;MACV,OAAI,OAAA,QAAA,KAAA;KACL;KACC,WAAW,CAAA,WAAO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B,IAAI,OAAA;IACF,OAAM,QAAA,QAAA;GACR;GACD,IAAA,WAAA;IACH,OAAA,CAAA,UAAA,gBAAA,OAAA,CAAA,CAAA,CAAA"}
1
+ {"version":3,"file":"yaml-file.mjs","names":[],"sources":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-alloy",
3
- "version": "0.26.216",
3
+ "version": "0.26.218",
4
4
  "description": "A package containing various Alloy framework components and helper utilities.",
5
5
  "keywords": ["alloy-js", "powerlines", "powerlines-plugin"],
6
6
  "homepage": "https://stormsoftware.com",
@@ -906,8 +906,8 @@
906
906
  "@alloy-js/json": "^0.23.0",
907
907
  "@alloy-js/markdown": "^0.23.0",
908
908
  "@alloy-js/typescript": "^0.23.0",
909
- "@powerlines/deepkit": "^0.9.77",
910
- "@powerlines/plugin-babel": "0.13.119",
909
+ "@powerlines/deepkit": "0.9.79",
910
+ "@powerlines/plugin-babel": "0.13.121",
911
911
  "@storm-software/config-tools": "^1.190.40",
912
912
  "@stryke/capnp": "^0.12.111",
913
913
  "@stryke/convert": "^0.7.15",
@@ -920,16 +920,16 @@
920
920
  "@stryke/types": "^0.12.12",
921
921
  "@stryke/unique-id": "^0.3.96",
922
922
  "defu": "^6.1.7",
923
- "powerlines": "0.47.123",
923
+ "powerlines": "0.47.125",
924
924
  "prettier": "^3.8.3",
925
925
  "unctx": "^2.5.0"
926
926
  },
927
927
  "devDependencies": {
928
- "@powerlines/plugin-plugin": "0.12.535",
928
+ "@powerlines/plugin-plugin": "0.12.537",
929
929
  "@types/node": "^25.9.1"
930
930
  },
931
931
  "peerDependencies": { "@alloy-js/babel-preset": ">=0.3.0" },
932
932
  "peerDependenciesMeta": { "@alloy-js/babel-preset": { "optional": false } },
933
933
  "publishConfig": { "access": "public" },
934
- "gitHead": "f8de1000ffda8a49be7fccbb6f53890449f7bdd3"
934
+ "gitHead": "30ba301952db7af53c07d369bd22f650e5ca9c45"
935
935
  }