@powerlines/plugin-alloy 0.26.111 → 0.26.113
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/typescript/components/property-name.cjs +1 -1
- package/dist/typescript/components/property-name.d.cts.map +1 -1
- package/dist/typescript/components/property-name.d.mts.map +1 -1
- package/dist/typescript/components/property-name.mjs +2 -2
- package/dist/typescript/components/property-name.mjs.map +1 -1
- package/package.json +6 -6
|
@@ -12,7 +12,7 @@ let _alloy_js_core = require("@alloy-js/core");
|
|
|
12
12
|
* If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.
|
|
13
13
|
*/
|
|
14
14
|
function PropertyName(props) {
|
|
15
|
-
if (props.name) return (0,
|
|
15
|
+
if (props.name) return (0, _alloy_js_core.memo)(() => {
|
|
16
16
|
if (props.private) return `#${props.name}`;
|
|
17
17
|
return quoteIfNeeded(props.name);
|
|
18
18
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-name.d.cts","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"property-name.d.cts","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"mappings":";;;UAsBiB,iBAAA;;;AAAjB;EAIE,IAAA;;;;EAKA,OAAA;AAAA;;;;;;;iBASc,YAAA,CAAa,KAAA,EAAO,iBAAA,GAAiB,iBAAA,CAAA,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-name.d.mts","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"property-name.d.mts","names":[],"sources":["../../../src/typescript/components/property-name.tsx"],"mappings":";;;UAsBiB,iBAAA;;;AAAjB;EAIE,IAAA;;;;EAKA,OAAA;AAAA;;;;;;;iBASc,YAAA,CAAa,KAAA,EAAO,iBAAA,GAAiB,iBAAA,CAAA,QAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { isValidJSIdentifier } from "../helpers/utilities.mjs";
|
|
2
2
|
import { memo } from "@alloy-js/core/jsx-runtime";
|
|
3
|
-
import { MemberDeclarationContext, useContext } from "@alloy-js/core";
|
|
3
|
+
import { MemberDeclarationContext, memo as memo$1, useContext } from "@alloy-js/core";
|
|
4
4
|
|
|
5
5
|
//#region src/typescript/components/property-name.tsx
|
|
6
6
|
/**
|
|
@@ -10,7 +10,7 @@ import { MemberDeclarationContext, useContext } from "@alloy-js/core";
|
|
|
10
10
|
* If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.
|
|
11
11
|
*/
|
|
12
12
|
function PropertyName(props) {
|
|
13
|
-
if (props.name) return memo(() => {
|
|
13
|
+
if (props.name) return memo$1(() => {
|
|
14
14
|
if (props.private) return `#${props.name}`;
|
|
15
15
|
return quoteIfNeeded(props.name);
|
|
16
16
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property-name.mjs","names":[],"sources":["../../../src/typescript/components/property-name.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 { MemberDeclarationContext, useContext } from \"@alloy-js/core\";\nimport {
|
|
1
|
+
{"version":3,"file":"property-name.mjs","names":[],"sources":["../../../src/typescript/components/property-name.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 { MemberDeclarationContext, memo, useContext } from \"@alloy-js/core\";\nimport { TSOutputSymbol } from \"@alloy-js/typescript\";\nimport { isValidJSIdentifier } from \"../helpers/utilities\";\n\nexport interface PropertyNameProps {\n /**\n * The name of the property.\n */\n name?: string;\n\n /**\n * Whether the property is a private property. If `true`, the property will be prefixed with `#`.\n */\n private?: boolean;\n}\n\n/**\n * A TypeScript property name for an interface, class, or object member.\n *\n * @remarks\n * If the name is not a valid JavaScript identifier, it will be quoted. If a `name` prop is provided, it will be used as the property name. Otherwise, the name will be taken from the {@link (MemberDeclarationContext:variable)}.\n */\nexport function PropertyName(props: PropertyNameProps) {\n if (props.name) {\n return memo(() => {\n if (props.private) {\n return `#${props.name}`;\n }\n return quoteIfNeeded(props.name!);\n });\n } else {\n const declSymbol = useContext(MemberDeclarationContext) as TSOutputSymbol;\n if (!declSymbol) {\n return \"(no member declaration context)\";\n }\n\n if (declSymbol.isPrivateMemberSymbol) {\n return <>#{declSymbol.name}</>;\n } else {\n return <>{quoteIfNeeded(declSymbol.name)}</>;\n }\n }\n}\n\nfunction quoteIfNeeded(name: string) {\n if (isValidJSIdentifier(name)) {\n return name;\n } else {\n return `\"${name.replace(/\"/g, '\\\\\"')}\"`;\n }\n}\n"],"mappings":";;;;;;;;;;;AA4BA,SAAI,aAAA,OAAA;AACF,KAAG,MAAO,KACR,QAAA,aAAA;AACF,MAAQ,MAAE,QACZ,QAAA,IAAA,MAAA;AAEE,SAAA,cAAA,MAAA,KAAA;GACG;MACJ;EACG,MAAA,aAAA,WAAA,yBAAA;AACD,MAAG,CAAG,WACP,QAAA;AAEE,MAAE,WAAY,sBACd,QAAO,CAAA,KAAQ,WAAG,WAAA,KAAA,CAAA;MAEhB,QAAE,CAAM,WAAW,cAAM,WAAA,KAAA,CAAA,CAAA;;;AAI/B,SAAS,cAAA,MAAA;AACP,KAAE,oBAAmB,KAAA,CACnB,QAAK;KAEL,QAAA,IAAA,KAAA,QAAA,MAAA,OAAA,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-alloy",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.113",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A package containing various Alloy framework components and helper utilities.",
|
|
6
6
|
"repository": {
|
|
@@ -295,8 +295,8 @@
|
|
|
295
295
|
"@alloy-js/json": "^0.23.0",
|
|
296
296
|
"@alloy-js/markdown": "^0.23.0",
|
|
297
297
|
"@alloy-js/typescript": "^0.23.0",
|
|
298
|
-
"@powerlines/deepkit": "^0.9.
|
|
299
|
-
"@powerlines/plugin-babel": "^0.13.
|
|
298
|
+
"@powerlines/deepkit": "^0.9.9",
|
|
299
|
+
"@powerlines/plugin-babel": "^0.13.26",
|
|
300
300
|
"@storm-software/config-tools": "^1.190.20",
|
|
301
301
|
"@stryke/capnp": "^0.12.102",
|
|
302
302
|
"@stryke/convert": "^0.7.7",
|
|
@@ -309,15 +309,15 @@
|
|
|
309
309
|
"@stryke/types": "^0.12.4",
|
|
310
310
|
"@stryke/unique-id": "^0.3.87",
|
|
311
311
|
"defu": "^6.1.7",
|
|
312
|
-
"powerlines": "^0.47.
|
|
312
|
+
"powerlines": "^0.47.30",
|
|
313
313
|
"prettier": "^3.8.3",
|
|
314
314
|
"unctx": "^2.5.0"
|
|
315
315
|
},
|
|
316
316
|
"devDependencies": {
|
|
317
|
-
"@powerlines/plugin-plugin": "^0.12.
|
|
317
|
+
"@powerlines/plugin-plugin": "^0.12.442",
|
|
318
318
|
"@types/node": "^25.8.0"
|
|
319
319
|
},
|
|
320
320
|
"peerDependencies": { "@babel/preset-typescript": ">=8.0.0-rc4" },
|
|
321
321
|
"publishConfig": { "access": "public" },
|
|
322
|
-
"gitHead": "
|
|
322
|
+
"gitHead": "3ea953f52abd046f1d1f28920d1a7758b91570f1"
|
|
323
323
|
}
|