npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@frctls/seabed

v0.2.9

Published

Common build environment and shared React components for Fractal web applications

Downloads

22

Readme

Seabed

A sturdy base for web projects. Seabed is built on the philosophy that you should have full visibility and control over your development and build process, while keeping a set of base configurations and shared components between projects. You are encouraged to thouroughly read the generated configuration files.

This project was created as a common environment for Fractal web applications.

Requirements

  • Node >= 10.13
  • Yarn

Browser support

  • last 2 versions
  • > 1%

Based on

How it works

Add Seabed to your project with yarn add @fractal/seabed.

yarn run seabed init to initialize your project with Seabed's default configurations. Any previously existing files will be compared, and their replacement confirmed.

What it generates

.browserslistrc                       // supported browsers
.eslintrc                             // ESLint rules
.gitattributes                        // GitHub support for proper JSX syntax highlighting in diffs
.gitignore                            // files ignored by git
.linguirc                             // LinguiJS configuration
.stylelintrc                          // stylelint rules
babel.config.js                       // Babel configuration
jest.config.js                        // Jest configuration
postcss.config.js                     // PostCSS configuration
production-configuration-server.js    // Express server to test production builds
svgo.config.json                      // SVG Optimizer configuration
webpack.common.js                     // Webpack common configuration
webpack.development.js                // Webpack development configuration (extends common)
webpack.production.js                 // Webpack production configuration (extends common)
src
├── assets
│   └── favicon.png                   // source image for favicon generation (transparent square PNG works best)
├── index.html                        // HTML template for React application to be rendered in
├── index.js                          // React application entry point
test
├── __mocks__
│   ├── fileMock.js                   // mock for file imports when running tests
│   └── styleMock.js                  // mock for stylesheet imports when running tests
└── test-helper.js                    // test helper with custom render function

Assumptions

You must create and maintain your own package.json file. These are the recommended scripts for development, building, testing, and i18n management.

{
  "scripts": {
    "start": "webpack-dev-server --config webpack.development.js",
    "lint": "eslint src test",
    "stylelint": "stylelint src/styles",
    "test": "yarn i18n-compile && TZ=UTC NODE_ENV=test jest test",
    "test:es-check": "yarn i18n-compile && dotenv -e .env.test yarn build && es-check es5 build/*.js",
    "build": "NODE_ENV=production webpack -p --config webpack.production.js",
    "test-build": "yarn i18n-compile && yarn build && node production-configuration-server.js",
    "i18n-add-locale": "lingui add-locale",
    "i18n-extract": "lingui extract",
    "i18n-compile": "lingui compile"
  },
}

What it provides

  • Webpack configurations for development and production environments, with support for
    • React
    • CSS and SCSS with vendor specific properties autoprefixing
    • Markdown
    • SVG with dynamic stroke and fill values per import (with support for custom -svg-stroke and -svg-fill CSS properties)
    • woff and woff2 fonts
    • .po language catalog files (using @lingui/loader)
    • Automatic favicon generation, based on whatever image is present in src/assets/favicon.png
    • Content Security Policy configuration for production mode
    • ES5 syntax checking before building
  • Circle CI configuration based on linux alpine
  • Babel 7, with support for
    • @babel/plugin-proposal-optional-chaining
    • @babel/proposal-class-properties
    • @babel/plugin-proposal-export-default-from
    • @babel/plugin-syntax-dynamic-import
    • babel-plugin-macros
    • babel-plugin-transform-imports
  • Jest
  • LinguiJS

Components

Usage of these components assumes that peerDependencies are installed:

  • react
  • react-dom
  • prop-types
  • classnames

Provided components

common

  • Confirmation (uses Modal internally)
  • DropdownMenu
  • Modal
  • ExternalLink

fields (for redux-form)

  • [] Checkbox
  • [] Input
  • [] RadioGroup
  • [] Textarea

CSS

Each of the available stylesheets is built with theming and customization in mind. We use CSS custom properties to achieve this. The available properties for each of the stylesheets are defined under :root.

For maximum compatibility with mobile devices, a --mobile-viewport-height is used on "fullscreen" mobile components, like Modal. This properties defaults to 100vh if not defined.

base.scss

import "@frctls/seabed/dist/base.scss"

This file must be included before all others, but after reset / normalize.

card.scss

import "@frctls/seabed/dist/card.scss";

modal.scss

import "@frctls/seabed/dist/modal.scss";

dropdown-menu.scss

import "@frctls/seabed/dist/dropdown-menu.scss";