0.1.8-sk0-sk1-hybrid.3 • Published 5 years ago

@sewing-kit/config v0.1.8-sk0-sk1-hybrid.3

Weekly downloads
1,224
License
MIT
Repository
github
Last release
5 years ago

@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');
});
0.4.0

5 years ago

0.3.0

5 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.2.0-alpha.1

5 years ago

0.1.12

5 years ago

0.1.11

5 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.38

6 years ago

0.0.37

6 years ago

0.0.35

6 years ago

0.0.36

6 years ago

0.0.33

6 years ago

0.0.34

6 years ago

0.0.32

6 years ago

0.0.30

6 years ago

0.0.31

6 years ago

0.0.27

6 years ago

0.0.26

6 years ago

0.0.25

6 years ago

0.0.24

6 years ago

0.0.23

6 years ago

0.0.22

6 years ago

0.0.20

6 years ago

0.0.21

6 years ago

0.0.19

6 years ago

0.0.17

6 years ago

0.0.18

6 years ago

0.0.16

6 years ago

0.0.15

6 years ago

0.0.12

6 years ago

0.0.13

6 years ago

0.0.14

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago