@charlietango/react-docs-net
Advanced tools
Comparing version
@@ -29,2 +29,3 @@ export type Config = { | ||
internal: boolean, | ||
isStatic: boolean, | ||
}; | ||
@@ -31,0 +32,0 @@ |
@@ -52,2 +52,3 @@ // | ||
const internal = !!description.match(/@internal/); | ||
const isStatic = !!description.match(/@static/); | ||
@@ -57,2 +58,3 @@ return { | ||
internal, | ||
isStatic, | ||
}; | ||
@@ -59,0 +61,0 @@ } |
@@ -8,2 +8,3 @@ // | ||
import { buildPropFlags } from '../helpers'; | ||
const upperFirst = require('lodash/fp/upperFirst'); | ||
@@ -65,3 +66,3 @@ const ns = require('../helpers').ns; | ||
const propsResult = injectProps(name, model.props, 8); | ||
const flags = buildPropFlags(model.description); | ||
const fileSource = `${getUsingTypes(propsResult.models, propsResult.props)} | ||
@@ -77,3 +78,3 @@ | ||
${model.see ? comment(model.see, 4, 'summary') : ''} | ||
public partial class ${name} | ||
public ${flags.isStatic ? 'static' : 'partial'} class ${name} | ||
{ | ||
@@ -80,0 +81,0 @@ ${propsResult.output} |
@@ -80,7 +80,7 @@ // | ||
output += `${' '.repeat(indent)}public virtual ${formatType( | ||
type, | ||
prop.required, | ||
isEnum | ||
)} ${upperFirst(name)} { get; set; }\n`; | ||
output += `${' '.repeat(indent)}public ${ | ||
flags.isStatic ? 'static' : 'virtual' | ||
} ${formatType(type, prop.required, isEnum)} ${upperFirst( | ||
name | ||
)} { get; set; }\n`; | ||
if (type.model) models.push(type.model); | ||
@@ -99,3 +99,3 @@ if (type.references) referencedModels.push(type.references); | ||
const propsResult = injectProps(model.displayName || name, model.props, 8); | ||
const flags = buildPropFlags(model.description); | ||
const fileSource = `${getUsingTypes(propsResult.models, propsResult.props)} | ||
@@ -111,3 +111,3 @@ | ||
${comment(model.description, 4)} | ||
public partial class ${modelName(name)} | ||
public ${flags.isStatic ? 'static' : 'partial'} class ${modelName(name)} | ||
{ | ||
@@ -114,0 +114,0 @@ ${propsResult.output} |
{ | ||
"name": "@charlietango/react-docs-net", | ||
"description": "Package and publish a NuGet package to a custom feed.", | ||
"version": "3.5.1", | ||
"version": "3.5.2", | ||
"main": "lib/index.js", | ||
@@ -48,3 +48,3 @@ "bin": { | ||
}, | ||
"gitHead": "d6a614ecdddca8fba8dd077ff6ba0cef59e0ca0b" | ||
"gitHead": "99e166cdf38f412fad158bd08fe089e65e72d725" | ||
} |
@@ -59,5 +59,6 @@ # React Docs Net | ||
You can use these **flags** to modify how a prop is handled. | ||
You can use these **flags** in JS comments to modify how a prop is handled. | ||
- `@internal` - Ignore this prop - It's only used internally in the React App. | ||
- `@type` - Set a specific C# type for this prop - Like `decimal` | ||
- `@static` - Marks classes or fields as static. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
49695
1.43%827
0.73%64
1.59%