Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@noths/shared-components-v1
Advanced tools
Set of shareable noths components
You will need both, the @noths/vendor-bundle
and @noths/shared-components
to use shared-components. The vendor bundle contains the react
and react-dom
and redux
dependencies.
Your application must use the same version of the vendor-bundle dependencies.
Install vendor bundle dependencies
npm install react@16.2.0 react-dom@16.2.0 redux@3.7.2
Install from NPM
npm install @noths/shared-components
npm install @noths/vendor-bundle
You will need the following in your package.json
:
"@noths/shared-components": "file:../frontend-packages/packages/shared-components",
"@noths/vendor-bundle": "file:../frontend-packages/packages/vendor-bundle",
PS: Don't forget to run npm run build
to generate the latest build for each package before starting to use it.
There is a separate import location to get the styled component version of a shared component
import { Button } from '@noths/shared-components/styled';
You can continue doing imports from both styled and the BEM/Scss implementation while migrating to styled components:
import { FormInput } from '@noths/shared-components';
import { Button } from '@noths/shared-components/styled';
This package generates <script>
and <style>
tags for integrating into your template.
In your template generator (your server.js or webpack config):
// 1. import utilities
import { createJsTag as createVendorJsTag } from '@noths/vendor-bundle';
import { createStyleTag, createJsTag } from '@noths/shared-components';
// 2. Generate tags, using development mode if needed
let sharedComponentsStyle = createStyleTag({ isDev });
let sharedComponentsJs = createJsTag({ isDev });
let vendorJS = createVendorJsTag({ isDev });
<!DOCTYPE html>
<html>
<head>
<title>App</title>
<!-- Shared-components style integration -->
{{{ sharedComponentsStyle }}}
</head>
<body>
<!-- Your Markup Container -->
<div id="app">{{{ renderedHtml }}}</div>
<!-- Shared-components javascript integration -->
{{{ vendorJS }}}
{{{ sharedComponentsJs }}}
<!-- Your Client App -->
<script src="{{ assets.app.js }}"></script>
</body>
</html>
const SharedComponentsPlugin = require('@noths/shared-components').SharedComponentsPlugin;
// Add the plugin to the webpack configuration
{
...
loaders: ...,
plugins: [new SharedComponentsPlugin()],
}
Import your shared-components like so:
import { Button } from '@noths/shared-components';
On the root folder run
npm run bootstrap
As part of a merge into master, storybook will be updated and made available here: http://unwrapped.notonthehighstreet.com/frontend-packages
To run and use storybook use the following command:
npm run storybook
Generate assets:
npm run build
Release version
npm version (major|minor|patch|[...tag])
npm publish
Beta version
npm run prerelease
FAQs
Legacy Shared components V1 for NOTHS
The npm package @noths/shared-components-v1 receives a total of 3 weekly downloads. As such, @noths/shared-components-v1 popularity was classified as not popular.
We found that @noths/shared-components-v1 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 34 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
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.