Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@puppet/uikit
Advanced tools
A toolkit for generating React projects, components, etc.
Install a recent version of Node.js (including npm), typically the latest LTS version, e.g.:
brew install node@10
To install uikit (or update it to the latest version) globally, making the uikit
command available in your shell:
npm install -g @puppet/uikit
The uikit includes a script for generating arbitrary boilerplate through template files. Available templates:
uikit generate project my-project
Generates a puppet React projectuikit generate page MyPage
Run from the root of a project (generated with the above command). Creates a route, item in navigation, and view component for a new page.uikit generate component MyComponent
Generates component boilerplate, including a test and scss fileuikit generate method myMethod
Generates utility method boilerplateuikit generate library my-library
Generates a React library appropriate for publishing as a consumable packageBy default the script will generate the template in the current working directory. Optionally you may specify a path to another directory with the --directory
(-d
) option:
uikit generate <template> <name> -d <path to directory>
Passing a --modules=true
or -m
option will generate code with scss module support
uikit and other design-system projects use the Puppet Design System project in Jira for tracking tickets: https://tickets.puppetlabs.com/browse/PDS
If you want to develop in this project but still want access to the scripts globally, clone this repo then run:
npm link
Then any script run with uikit <command>
will access the most recent code in your local repo.
The uikit generator script will execute a command of the form uikit generate <template> <name>
if there is a matching template in /templates
and the specified template is 'registered' as a valid cli option.
To create a new generator template:
TEMPLATE_OPTIONS
in bin/uikit.js
..handlebars
extension, the generator script will compile it as a handlebars template, stripping the .handlebars
extension from the filename. The handlebars template will have access to the following variables:name
: An object with name variants derived from the CLI argument:
name.original
: The unmodified CLI argumentname.humanized
: Capitalized words with spaces (e.g. My Component
)name.pascalized
: Upper camel-cased aka Pascal cased name (e.g. MyComponent
)name.camelized
: Lower camel-cased name (e.g. myComponent
)name.dasherized
: Kebab-cased name (e.g. my-component
)In addition, the filename itself of .handlebars
files will be compiled as a handlebars template. This is useful if you want to generate named files such as MyComponent.jsx
.
.uikitrc.js
file to the template directory. The file should optionally export a preGenerate
and postGenerate
action, each passed the destination directory of the resulting templated output.module.exports = {
preGenerate({ dest }) {
// ...
},
postGenerate({ dest }) {
// ...
},
};
FAQs
A toolkit for generating React projects, components, etc.
The npm package @puppet/uikit receives a total of 2 weekly downloads. As such, @puppet/uikit popularity was classified as not popular.
We found that @puppet/uikit demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.