
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@smashgg/gg-components
Advanced tools
gg-components is a Component / Pattern Library. Visualized by http://storybook.smash.gg/
git clone git@github.com:smashgg/gg-components.git
.cd gg-components
.npm run setup
.localhost:8080
.npm run storybook
.localhost:6006
.npm run tdd
.ComponentName.spec.js
file in the same directory as the component you are testing (e.g. MyFoo/MyFoo.jsx, MyFoo/MyFoo.spec.js). Your first test could assert that
the component returns the element you expect it to when render is called, for example:describe('GettingStarted', () => {
test('is a span element', () => {
const wrapper = shallow(<GettingStarted />);
expect(wrapper.type()).toEqual('span');
});
});
ComponentName
directory in the src/components
directory. This directory should have
at least 2 files: index.jsx
and ComponentName.jsx
. index.jsx
just imports and exports
./ComponentName.jsx
.Continue adding Tests into your test spec. It's best practice to write failing tests that resolve themselves while you continue writing your new component.
Once your component is nearing a completed state, it's time to export the component to Storybook.
To prepare your component to be exported, you currently need to add the component to src/index.js
.
It's probably time for you to read the docs of https://github.com/smashgg/gg-storybook!
npm run prepublish
(Webpack builds all required vendor dlls and our code with npm run dll && npm run build
).npm publish
here and npm version
here.npm run publish:patch
it will auto bump to a new version and publish the package and create a new commit with the same information. Don't forget to push the version commit so we track the new publishReact CSS Modules automates loading of CSS Modules using the styleName property. The easiest way to think about the difference between StyleName and ClassName is the below example:
<div className='global-css' styleName='local-module'></div>
The convention for React CSS Modules is that styleName is for Interoperable CSS (CSS Modules) and className is for CSS.
Example:
/* JSX */
import React from 'react';
import './index.css';
function Apple() {
return (
<div
className="fa fa-apple"
styleName="apple"
/>
);
}
export default Apple;
/* CSS */
.apple {
color: #f00;
}
Result:
<div className="fa fa-apple src-components-Apple-___index__apple___2KF4L"></div>
This does not work:
$margins : var(--spacing--sm);
.foo {
margin: -$margins 0 $margins -$margins;
}
Works:
$margins : var(--spacing--sm);
.foo {
margin: calc($margins * -1) 0 $margins calc($margins * -1);
}
FAQs
A Component Pattern Library for GG-Web
The npm package @smashgg/gg-components receives a total of 22 weekly downloads. As such, @smashgg/gg-components popularity was classified as not popular.
We found that @smashgg/gg-components demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.