@powerlines/plugin-alloy 0.26.205 → 0.26.207

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/render.cjs CHANGED
@@ -37,7 +37,7 @@ async function render(context, children) {
37
37
  });
38
38
  if (!files.length) context.debug("No output files were rendered by the Alloy-js components.");
39
39
  else {
40
- context.debug(`Rendering ${files.length} output files from Alloy-js components: ${(0, _stryke_string_format_list.list)(files.map((f) => (0, _stryke_path_replace.replacePath)(f.path, context.config.cwd)))}.`);
40
+ context.debug(`Rendering ${files.length} output files from Alloy-js components: ${(0, _stryke_string_format_list.list)(files.map((file) => `${(0, _stryke_path_replace.replacePath)(file.path, context.config.cwd)}${meta[file.path]?.kind === "builtin" || meta[file.path]?.kind === "infrastructure" ? ` (${meta[file.path]?.kind === "builtin" ? "Builtin" : "Infrastructure"})` : ""}`))}.`);
41
41
  await (0, _alloy_js_core.traverseOutput)(output, {
42
42
  visitDirectory: (directory) => {
43
43
  if (context.fs.existsSync(directory.path)) return;
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.cts","names":[],"sources":["../src/render.tsx"],"mappings":";;;;;;AAgDA;;;;;;;;;;;;iBAAsB,MAAA,kBAAwB,aAAA,EAC5C,OAAA,EAAS,QAAA,EACT,QAAA,EAAU,QAAA,GAAQ,OAAA;;;;;AAAA;AA+FpB;;;;;;;;;;iBAAgB,YAAA,kBAA8B,aAAA,EAC5C,OAAA,EAAS,QAAA,EACT,QAAA,EAAU,QAAA,EACV,OAAA,GAAU,gBAAA"}
1
+ {"version":3,"file":"render.d.cts","names":[],"sources":["../src/render.tsx"],"mappings":";;;;;;AAgDA;;;;;;;;;;;;iBAAsB,MAAA,kBAAwB,aAAA,EAC5C,OAAA,EAAS,QAAA,EACT,QAAA,EAAU,QAAA,GAAQ,OAAA;;;;;AAAA;AA2GpB;;;;;;;;;;iBAAgB,YAAA,kBAA8B,aAAA,EAC5C,OAAA,EAAS,QAAA,EACT,QAAA,EAAU,QAAA,EACV,OAAA,GAAU,gBAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"render.d.mts","names":[],"sources":["../src/render.tsx"],"mappings":";;;;;;AAgDA;;;;;;;;;;;;iBAAsB,MAAA,kBAAwB,aAAA,EAC5C,OAAA,EAAS,QAAA,EACT,QAAA,EAAU,QAAA,GAAQ,OAAA;;;;;AAAA;AA+FpB;;;;;;;;;;iBAAgB,YAAA,kBAA8B,aAAA,EAC5C,OAAA,EAAS,QAAA,EACT,QAAA,EAAU,QAAA,EACV,OAAA,GAAU,gBAAA"}
1
+ {"version":3,"file":"render.d.mts","names":[],"sources":["../src/render.tsx"],"mappings":";;;;;;AAgDA;;;;;;;;;;;;iBAAsB,MAAA,kBAAwB,aAAA,EAC5C,OAAA,EAAS,QAAA,EACT,QAAA,EAAU,QAAA,GAAQ,OAAA;;;;;AAAA;AA2GpB;;;;;;;;;;iBAAgB,YAAA,kBAA8B,aAAA,EAC5C,OAAA,EAAS,QAAA,EACT,QAAA,EAAU,QAAA,EACV,OAAA,GAAU,gBAAA"}
package/dist/render.mjs CHANGED
@@ -36,7 +36,7 @@ async function render(context, children) {
36
36
  });
37
37
  if (!files.length) context.debug("No output files were rendered by the Alloy-js components.");
38
38
  else {
39
- context.debug(`Rendering ${files.length} output files from Alloy-js components: ${list(files.map((f) => replacePath(f.path, context.config.cwd)))}.`);
39
+ context.debug(`Rendering ${files.length} output files from Alloy-js components: ${list(files.map((file) => `${replacePath(file.path, context.config.cwd)}${meta[file.path]?.kind === "builtin" || meta[file.path]?.kind === "infrastructure" ? ` (${meta[file.path]?.kind === "builtin" ? "Builtin" : "Infrastructure"})` : ""}`))}.`);
40
40
  await traverseOutput(output, {
41
41
  visitDirectory: (directory) => {
42
42
  if (context.fs.existsSync(directory.path)) return;
@@ -1 +1 @@
1
- {"version":3,"file":"render.mjs","names":[],"sources":["../src/render.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 printTree,\n PrintTreeOptions,\n renderAsync,\n renderTree,\n traverseOutput\n} from \"@alloy-js/core\";\nimport { noop } from \"@stryke/helpers/noop\";\nimport { findFileExtension } from \"@stryke/path/file-path-fns\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { list } from \"@stryke/string-format/list\";\nimport { PluginContext } from \"powerlines\";\nimport { MetaItem, Output } from \"./core\";\nimport { OutputFile } from \"./types\";\n\n/**\n * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.\n *\n * @example\n * ```tsx\n * import { render } from \"@powerlines/plugin-alloy/render\";\n *\n * await render(context, <> ... </>);\n * ```\n *\n * @param context - The Powerlines plugin context.\n * @param children - The children components to render.\n * @returns A promise that resolves when rendering is complete.\n */\nexport async function render<TContext extends PluginContext>(\n context: TContext,\n children: Children\n) {\n const meta = {} as Record<string, MetaItem>;\n const output = await renderAsync(\n <Output context={context} meta={meta}>\n {children}\n </Output>\n );\n\n const files = [] as OutputFile[];\n await traverseOutput(output, {\n visitDirectory: noop,\n visitFile: file => files.push(file)\n });\n\n if (!files.length) {\n context.debug(\"No output files were rendered by the Alloy-js components.\");\n } else {\n context.debug(\n `Rendering ${files.length} output files from Alloy-js components: ${list(\n files.map(f => replacePath(f.path, context.config.cwd))\n )}.`\n );\n\n await traverseOutput(output, {\n visitDirectory: directory => {\n if (context.fs.existsSync(directory.path)) {\n return;\n }\n\n context.fs.mkdirSync(directory.path);\n },\n visitFile: file => {\n if (\"contents\" in file) {\n const metadata = meta[file.path] ?? {};\n if (metadata.kind === \"builtin\") {\n if (!metadata.id) {\n throw new Error(\n `Built-in file \"${\n file.path\n }\" is missing its ID in the render metadata.`\n );\n }\n\n context.emitBuiltinSync(file.contents, metadata.id, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n extension: findFileExtension(file.path)\n });\n } else if (metadata.kind === \"entry\") {\n context.emitEntrySync(file.contents, file.path, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n ...(metadata.typeDefinition ?? {})\n });\n } else if (metadata.kind === \"infrastructure\") {\n if (!metadata.id) {\n throw new Error(\n `Infrastructure file \"${\n file.path\n }\" is missing its ID in the render metadata.`\n );\n }\n\n context.emitInfrastructureSync(file.contents, metadata.id, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n extension: findFileExtension(file.path)\n });\n } else {\n context.emitSync(file.contents, file.path, metadata);\n }\n } else {\n context.fs.copySync(file.sourcePath, file.path);\n }\n }\n });\n }\n}\n\n/**\n * A function to render children components within the [Alloy](https://alloy-framework.github.io) context and return the rendered output as a string.\n *\n * @example\n * ```tsx\n * import { renderString } from \"@powerlines/plugin-alloy/render\";\n *\n * const output = await renderString(context, <> ... </>);\n * ```\n *\n * @param context - The Powerlines plugin context.\n * @param children - The children components to render.\n * @param options - Optional print tree options.\n * @returns The rendered output as a string.\n */\nexport function renderString<TContext extends PluginContext>(\n context: TContext,\n children: Children,\n options?: PrintTreeOptions\n) {\n const tree = renderTree(<Output context={context}>{children}</Output>);\n\n return printTree(tree, options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0CA,eAAK,OAAA,SAAA,UAAA;CACJ,MAAA,OAAA,CAAA;CACC,MAAE,SAAa,MAAM,YAAY,gBAAc,UAAA;EACvC;EACN;EACF;CACF,CAAA,CAAA;CACE,MAAA,QAAS,CAAA;CACT,MAAA,eAAU,QAAA;EACV,gBAAA;EACA,YAAa,SAAM,MAAO,KAAM,IAAE;CAClC,CAAA;CACA,IAAG,CAAA,MAAO,QACR,QAAG,MAAQ,2DAAA;MACT;EACH,QAAA,MAAA,aAAA,MAAA,OAAA,0CAAA,KAAA,MAAA,KAAA,MAAA,YAAA,EAAA,MAAA,QAAA,OAAA,GAAA,CAAA,CAAA,EAAA,EAAA;;GAED,iBAAoB,cAAY;IAC1B,IAAA,QAAA,GAAe,WAAQ,UAAA,IAAA,GAC3B;IAEA,QAAA,GAAA,UAAA,UAAA,IAAA;;GAEE,YAAO,SAAQ;IACjB,IAAQ,cAAU,MAAO;KACpB,MAAA,WAAA,KAAA,KAAA,SAAA,CAAA;KACL,IAAQ,SAAK,SAAA,WAAA;MACV,IAAS,CAAC,SAAQ,IACX,MAAM,IAAG,MAAA,kBAAoB,KAAQ,KAAO,4CAAI;MAEzD,QAAA,gBAAA,KAAA,UAAA,SAAA,IAAA;;OAEK,SAAA,SAAsB;OAC1B,WAAgB,kBAAa,KAAA,IAAA;MACvB,CAAA;KACF,OAAM,IAAA,SAAA,SAAA,SACR,QAAA,cAAA,KAAA,UAAA,KAAA,MAAA;;MAEA,SAAW,SAAU;MACtB,GAAA,SAAA,kBAAA,CAAA;KACD,CAAA;UACO,IAAQ,SAAS,SAAE,kBAAA;MACtB,IAAM,CAAA,SAAU,IACZ,MAAA,IAAS,MAAO,wBAAa,KAAA,KAAA,4CAAA;MAE/B,QAAQ,uBAAS,KAAA,UAAA,SAAA,IAAA;OACf,YAAY,SAAO;OACnB,SAAS,SAAA;OACT,WAAQ,kBAAqB,KAAC,IAAO;MACvC,CAAC;KACH;IAGF,OACE,QAAI,GAAO,SAAE,KAAS,YAAO,KAAA,IAAA;GAEjC;EACF,CAAC;CACH;AACF;;;;;;;;;;;;;;;;AAiBA,SAAc,aAAA,SAAA,UAAA,SAAA;CAKZ,OAAO,UAJG,WAAK,gBAAA,UAAA;EACL;EACF;CACR,CAAC,CACkB,GAAA,OAAS;AAC9B"}
1
+ {"version":3,"file":"render.mjs","names":[],"sources":["../src/render.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 printTree,\n PrintTreeOptions,\n renderAsync,\n renderTree,\n traverseOutput\n} from \"@alloy-js/core\";\nimport { noop } from \"@stryke/helpers/noop\";\nimport { findFileExtension } from \"@stryke/path/file-path-fns\";\nimport { replacePath } from \"@stryke/path/replace\";\nimport { list } from \"@stryke/string-format/list\";\nimport { PluginContext } from \"powerlines\";\nimport { MetaItem, Output } from \"./core\";\nimport { OutputFile } from \"./types\";\n\n/**\n * A function to render children components within the [Alloy](https://alloy-framework.github.io) context, and write any saved content to the file system.\n *\n * @example\n * ```tsx\n * import { render } from \"@powerlines/plugin-alloy/render\";\n *\n * await render(context, <> ... </>);\n * ```\n *\n * @param context - The Powerlines plugin context.\n * @param children - The children components to render.\n * @returns A promise that resolves when rendering is complete.\n */\nexport async function render<TContext extends PluginContext>(\n context: TContext,\n children: Children\n) {\n const meta = {} as Record<string, MetaItem>;\n const output = await renderAsync(\n <Output context={context} meta={meta}>\n {children}\n </Output>\n );\n\n const files = [] as OutputFile[];\n await traverseOutput(output, {\n visitDirectory: noop,\n visitFile: file => files.push(file)\n });\n\n if (!files.length) {\n context.debug(\"No output files were rendered by the Alloy-js components.\");\n } else {\n context.debug(\n `Rendering ${files.length} output files from Alloy-js components: ${list(\n files.map(\n file =>\n `${replacePath(file.path, context.config.cwd)}${\n meta[file.path]?.kind === \"builtin\" ||\n meta[file.path]?.kind === \"infrastructure\"\n ? ` (${\n meta[file.path]?.kind === \"builtin\"\n ? \"Builtin\"\n : \"Infrastructure\"\n })`\n : \"\"\n }`\n )\n )}.`\n );\n\n await traverseOutput(output, {\n visitDirectory: directory => {\n if (context.fs.existsSync(directory.path)) {\n return;\n }\n\n context.fs.mkdirSync(directory.path);\n },\n visitFile: file => {\n if (\"contents\" in file) {\n const metadata = meta[file.path] ?? {};\n if (metadata.kind === \"builtin\") {\n if (!metadata.id) {\n throw new Error(\n `Built-in file \"${\n file.path\n }\" is missing its ID in the render metadata.`\n );\n }\n\n context.emitBuiltinSync(file.contents, metadata.id, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n extension: findFileExtension(file.path)\n });\n } else if (metadata.kind === \"entry\") {\n context.emitEntrySync(file.contents, file.path, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n ...(metadata.typeDefinition ?? {})\n });\n } else if (metadata.kind === \"infrastructure\") {\n if (!metadata.id) {\n throw new Error(\n `Infrastructure file \"${\n file.path\n }\" is missing its ID in the render metadata.`\n );\n }\n\n context.emitInfrastructureSync(file.contents, metadata.id, {\n skipFormat: metadata.skipFormat,\n storage: metadata.storage,\n extension: findFileExtension(file.path)\n });\n } else {\n context.emitSync(file.contents, file.path, metadata);\n }\n } else {\n context.fs.copySync(file.sourcePath, file.path);\n }\n }\n });\n }\n}\n\n/**\n * A function to render children components within the [Alloy](https://alloy-framework.github.io) context and return the rendered output as a string.\n *\n * @example\n * ```tsx\n * import { renderString } from \"@powerlines/plugin-alloy/render\";\n *\n * const output = await renderString(context, <> ... </>);\n * ```\n *\n * @param context - The Powerlines plugin context.\n * @param children - The children components to render.\n * @param options - Optional print tree options.\n * @returns The rendered output as a string.\n */\nexport function renderString<TContext extends PluginContext>(\n context: TContext,\n children: Children,\n options?: PrintTreeOptions\n) {\n const tree = renderTree(<Output context={context}>{children}</Output>);\n\n return printTree(tree, options);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AA0CA,eAAK,OAAA,SAAA,UAAA;CACJ,MAAA,OAAA,CAAA;CACC,MAAE,SAAa,MAAM,YAAY,gBAAc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,MAAA,QAAA;IAEC,OACE,QAAM,GAAA,SAAW,KAAK,YAAe,KAAC,IAAA;GAE1C;EACF,CAAC;CACH;AACF;;;;;;;;;;;;;;;;AAiBA,SAAgB,aAAa,SAAC,UAAA,SAAA;CAK5B,OAAO,UAJK,WAAU,gBAAK,UAAA;EAChB;EACC;CACZ,CAAC,CACY,GAAA,OAAA;AACf"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-alloy",
3
- "version": "0.26.205",
3
+ "version": "0.26.207",
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.73",
910
- "@powerlines/plugin-babel": "^0.13.108",
909
+ "@powerlines/deepkit": "0.9.74",
910
+ "@powerlines/plugin-babel": "0.13.110",
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.112",
923
+ "powerlines": "0.47.114",
924
924
  "prettier": "^3.8.3",
925
925
  "unctx": "^2.5.0"
926
926
  },
927
927
  "devDependencies": {
928
- "@powerlines/plugin-plugin": "^0.12.524",
928
+ "@powerlines/plugin-plugin": "0.12.526",
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": "4188b20fb27952ae064661f355b081a708e1c4f8"
934
+ "gitHead": "c7982ab72dab413b5515c548d84f5bd39240abe5"
935
935
  }