New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sewing-kit/config

Package Overview
Dependencies
Maintainers
3
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sewing-kit/config

This package provides a number functions to create sewing-kit configs. These functions can be used to create a config for a given `Project` or `Workspace`.

  • 0.1.8-sk0-sk1-hybrid.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
increased by20%
Maintainers
3
Weekly downloads
 
Created
Source

@sewing-kit/config

This package provides a number functions to create sewing-kit configs. These functions can be used to create a config for a given Project or Workspace.

A sewing-kit config (sewing-kit.config.ts) file is required in the root folder of each Project or Workspace.

Installation

yarn add @sewing-kit/config --dev

API

The bulk of a sewing-kit config consists of configuring sewing-kit plugins. Default plugins are provided within the @sewing-kit/* ecosystem, or consumers can create their own plugin to define their custom configuration.

createWorkspace

Use createWorkspace in a sewing-kit.config.ts file to define a workspace. The following config file defines the sewing-kit workspace itself. A workspace that uses eslint, jest, and TypeScript.

// sewing-kit.config.ts

import {createWorkspace} from '@sewing-kit/config';

import {eslint} from '@sewing-kit/plugin-eslint';
import {jest} from '@sewing-kit/plugin-jest';
import {workspaceTypeScript} from '@sewing-kit/plugin-typescript';

export default createWorkspace((workspace) => {
  workspace.use(eslint(), jest(), workspaceTypeScript());
});

createPackage

Use createPackage in a sewing-kit.config.ts file to define a package in the workspace. Sewing-kit itself uses this to define its own packages as follows:

// packages/some-package

import {createPackage, Runtime} from '@sewing-kit/config';
import {createSewingKitPackagePlugin} from '../../config/sewing-kit';

export default createPackage((pkg) => {
  // tells sewing-kit that we're building a Node.js package
  pkg.runtime(Runtime.Node);

  // tell sewing-kit what kind of build outputs you want available
  pkg.use(createSewingKitPackagePlugin());
});

createWebApp

createWebApp is used to create a web application within a given Workspace. Generally speaking, this would be a React app.

// app/ui/sewing-kit.config.ts

import {createWebApp} from '@sewing-kit/config';
import {myPlugins} from '../../config/my-plugins';

export default createWebApp((app) => {
  // tell sewing-kit the entry into the app
  app.entry('./index');

  // apply your preferred plugins for your app
  // TODO: provide more specifc preconfigured plugins
  app.use(myPlugins());
});

createService

Use createService in a sewing-kit.config.ts file to define a service in the workspace. In the context of sewing-kit, a service refers to a Node.js server.

// server/sewing-kit.config.ts

import {createService} from '@sewing-kit/config';

export default createWebApp((app) => {
  // tell sewing-kit the entry into the server
  app.entry('./server');
});

FAQs

Package last updated on 01 Mar 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc