
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
This repo provides the tools to implement view components which make up the visual appearance of Nitro.
The intent of this repo is to provide a base on which other UIs can be built such that they maintain visual consistency and the Nitro brand.
From the current project directory, run:
package.json => engines)yarn installyarn run storybookIts easy to create and test out a component on nitro in real time, even with hot reload. You can point your local storybook folder as you develop it.
gem "nitro_sg", :path => "/path/to/storybook/locally"
”nitro-storybook": "/path/to/storybook/locally"
if you have any problems with assets not showing try running:
bundle exec rake assets:clobber
You’ll need to point to a something published on GitHub when your ready to deploy it. Here are some options for you:
gem "nitro_sg", git: "git@github.com:powerhome/nitro-styleguide.git", tag: "v1.2.1"
gem "nitro_sg", git: "git@github.com:powerhome/nitro-styleguide.git", ref: "4aded"
gem "nitro_sg", git: "git@github.com:powerhome/nitro-styleguide.git", branch: "branchname"
"nitro-storybook": "git+ssh://git@github.com/powerhome/nitro-storybook.git#branchname",
Check the releases and increase your version by 1 in the following files:
lib/nitro_sg/version.rb
package.json
Be sure and run the following anytime you version up:
yarn install && bundle install
Get your nitro-storybook PR approved and merged into the nitro-storybook's master branch.
Once your merged you need to create a tag so we can reference this version. Here are some easy ways to create and delete tags:
git tag v1.0.1
git push origin v1.0.1
git tag -d v1.0.1
git push --delete origin v1.0.1
"nitro-storybook": "git+ssh://git@github.com/powerhome/nitro-storybook.git#v1.9.2",
gem "nitro_sg", git: "git@github.com:powerhome/nitro-storybook.git", tag: "v1.9.2"
If your updated styling doesn’t show up, you may have old assets you need to remove.
bundle exec rake assets:clobber
Creation of new components requires a bit of forethought. Ask yourself these questions first:
nitro_react ?
Here are the steps to creating a new Foo component (in order):
/components named FooFoo.jsx inside the directory with the contents:
/* @flow */
import React from 'react'
type Props = {}
export default class Foo extends React.Component<Props> {
static defaultProps = {}
props: Props
render() {
return <span>{`I'm a Foo`}</span>
}
}
styles.scss inside the directory with the contents:
.foo {}
import styles from './styles.scss'
styles.foo as the className:
render() {
return <span className={styles.foo}>{`I'm a Foo`}</span>
}
Foo.jsx to the component index in components/index.js
export Foo from './Foo/Foo.jsx'
FooStory.jsx with the contents:
import React from "react"
import Foo from "./Foo"
import { text, select, boolean } from "@storybook/addon-knobs"
export default function FooStory(stories) {
stories.add("Foo",
() => {
let props = {}
return (
<Foo {...props}/>
)
}
)
}
Foo is pretty simply 😁, hence we will add it to /stories/basic.js like so:
export FooStory from '../components/Foo/FooStory'
This will add your Foo story to the categoy "Basic Components" in StorybookConversion of existing components in nitro_react is a little different since we already have a decent class structure in the jsx component. There are, however, a few considerations:
PropTypesclass instead of function (see the examples below)Props flow type
type Props = {
children?: Array<React.Node>,
bold: boolean,
italic: boolean,
className: string,
}
export default class Foo extends React.Component<Props> {
static defaultProps = {}
props: Props
...
this.props in any of your methods in the normal way
const {bar} = this.props
yarn run lintyarn run lint-fix which will automagically fix things like indentation.FAQs
Nitro UI Styleguide + React component dev env
We found that nitro-sg demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.