
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
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 install
yarn run storybook
Its 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 Foo
Foo.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:
PropTypes
class
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 lint
yarn run lint-fix
which will automagically fix things like indentation.FAQs
Unknown package
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
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.