
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
@charlietango/react-docs-net
Advanced tools
Supply Chain Security
Vulnerability
Quality
Maintenance
License
Take the JSON output from react-docgen, and convert it C# ViewModels for consumption in .NET projects. Why would you do this? It allows us to define the ViewModels in the Frontend where we actually use them.
This is a basic rewrite of the React props to C#/.NET. No validation is done on the actual files. Not all Flow features are supported, since there's not a simple way to convert them to C#.
number
is converted to int
. Use @type {TYPE}
in comment tag for the prop, to change the number type.Add the dependency
yarn add @charlietango/react-docs-net --dev
Generate JSON files with react-docgen, and process them:
const docNet = require('@charlietango/react-docs-net');
docNet.fromJson('src/models/**/*.json', {
namespace: 'Dk.CharlieTango',
dest: 'dist/models', // Add dest to write to files
});
or create the models with the models directly
Generate JSON files with react-docgen
, and process them:
const docNet = require('@charlietango/react-docs-net');
docNet.createModels([{name: 'CustomModel', docs: {...}}], {
namespace: 'Dk.CharlieTango',
dest: 'dist/models', // Add dest to write to files
});
or calling the bin
$ react-doc-net src/models/**/*.json --ns Dk.CharlieTango --dest dist/models
The .cs
view models will be created in dist/models
.
Name | Type | Default | Description |
---|---|---|---|
namespace | string | Namespace to use in all the models | |
dest | string | Write .cs files to the this path | |
verbose | boolean | false | Output extra logging |
quiet | boolean | false | Don't output anything to log |
You can use these flags 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
FAQs
Package and publish a NuGet package to a custom feed.
The npm package @charlietango/react-docs-net receives a total of 54 weekly downloads. As such, @charlietango/react-docs-net popularity was classified as not popular.
We found that @charlietango/react-docs-net demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.