Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@hackthenorth/north
Advanced tools
North is Hack the North's frontend component library, built for use in React.
👉👉👉 See all the components 👈👈👈
First, install the package in your project:
$ npm install --save @hackthenorth/north
North components derive their styling from a theme definition file.
When creating a theme for North, you can provide the following in your theme definition:
globalStyles
: a css
object that defines styles to be applied globally
globalConstants
: an object containing constants that you want to be able to access when defining styled components
deviceBreakpoints
: an object containing maximum width breakpoints for different device names
modifiers
: each North component can have two properties defined in the theme definition:
sharedStyles
: similar to globalStyles
, this defines styles shared by all instances of this specific North componentmods
: each key you specify in this property will be a modifier name that can be specified when using a North component to apply the corresponding style values defined in modifiers
. A component can use multiple modifiers using any format accepted by the classnames library. Example usage: <Button mods="error"/>
<Button mods=["error", "secondary"]>
<Button mods={error: SOME_CONDITIONAL, secondary: ANOTHER_CONDITIONAL}>
An example of a theme definition can be found in src/themes/storybook.ts
, and more detailed schemas can be found through the TypeScript interface definitions in the source code.
After your theme has been defined, provide it to North by wrapping your application with a North
provider component.
// yourApp.js
import { North } from "@hackthenorth/north"; // import the provider
import YOUR_THEME_DEFINITION from "path/to/your/theme-def/file"; // your theme definition file
const App = () => (
<North themeDefinition={YOUR_THEME_DEFINITION}>
// rest of your app here...
</North>
);
To use a themed North component:
import { Card } from "@hackthenorth/north"; // import the component
// ...your component...
return <Card mods="YOUR_MODIFIER_NAME" />;
// ...your component...
The modifier name should be defined in your theme definition under the modifiers
property of the component you're using.
First, clone the repo:
$ git clone https://github.com/hackathon/north.git
$ cd north
Then install dependencies and get it running:
$ npm install
$ npm start
Navigate to localhost:9001
in your browser. This will load the Storybook documentation for North, where you can see every component in the North component library.
Here's a handy dandy checklist to cover when you're adding a new component:
displayName
s set.test.tsx
file.stories.tsx
filethemeFromDefinition
function here (in alphabetical order)ThemeDefinition
and Theme
interfaces here (in alphabetical order)When changes are ready to be released, do the following:
master
into release
[major]|[minor]|[patch]
based on the changes and (very roughly) according to semantic versioningThe hackthenorth-platform
bot will automatically tag the release based on the previous version and your prefix before building and publishing the new version of the package to npm.
Components are built with React, and written in TypeScript. Tests are written in Jest, and test functionality as well as snapshot comparisons. The website is just an instance of Storybook, deployed to Github Pages by Buildkite every time we publish a new version. Rollup is used to create the published package.
We use styled-components
to apply styles and for the theming ability that it provides.
The Carousel
, Dropdown
, Gallery
, and ProgressBar
components are deprecated and removed as of version
1.0` of North.
Check out the 2019 shitlist as a starting point.
FAQs
Hack the North's reusable component library
We found that @hackthenorth/north 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.