Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
@substrate/design-system
Advanced tools
Building components
Maintaining the system
npm install --save @substrate/design-system
Components within the design system assume that a set of global styles have been configured. Depending upon the needs of the application, this can be done several ways:
GlobalStyle
componentUseful when you don't need any custom body
styling in the application, typically this would be placed in a layout component that wraps all pages, or a top-level App
component.
import { global } from '@storybook/design-system';
const { GlobalStyle } = global;
/* Render the global styles once per page */
<GlobalStyle />
bodyStyles
to apply stylingUseful when you want build upon the shared global styling.
import { createGlobalStyle } from 'styled-components';
import { global } from '@storybook/design-system';
const { bodyStyles } = global;
const CustomGlobalStyle = createGlobalStyle`
body {
${bodyStyles}
// Custom body styling for the app
}
`;
/* Render the global styles once per page */
<CustomGlobalStyle />
Rather than @import
fonts in the GlobalStyle
component, the design system's font URL is exported with the intention of using it in a <link>
tag as the href. Different frameworks and environments handle component re-renders in their own way (a re-render would cause the font to be re-fetched), so this approach allows the design system consumers to choose the font loading method that is most appropriate for their environment.
import { global } from '@storybook/design-system';
const fontLink = document.createElement('link');
fontLink.href = global.fontUrl;
fontLink.rel = 'stylesheet';
document.head.appendChild(fontLink);
import React from 'react';
import { global } from '@storybook/design-system';
const Layout = ({ children }) => (
<html>
<head>
<link href={global.fontUrl} rel="stylesheet" />
</head>
<body>{children}</body>
</html>
);
export default Layout;
yarn release
Bump the version
Push a release to GitHub and npm
Push a changelog to GitHub
Notes:
npm adduser
auto
is used to generate a changelog and push it to GitHub. In order for this to work correctly, an environment variable called GH_TOKEN
is needed that references a GitHub personal access token with the appropriate permissions to update the repo.FAQs
Substrate design system
We found that @substrate/design-system demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.