open-index/open-npm huggingface dataset:
npm package: @sewing-kit/core
Description: The core data models for sewing-kit-next
Author: Shopify Inc.
Latest version: 0.6.4
Deprecated: This package is deprecated. Please migrate to @shopify/loom

# `@sewing-kit/core`

## Modeling

Sewing-kit parses the shape of a codebase by modeling it into concepts it understands. At a high-level these these concepts are a `Workspace` and `Project`.

### Project

A `Project` can be a either a `Package` (NPM library), `WebApp` (a react app) or `Service` (a Node.js server).

### Workspace

A `Workspace` is a composition of `Project`s. It includes all the `WebApp`, `Package`, and `Services` for a given codebase.

### Base

`Workspace`, `WebApp`, `Package`, and `Service` all extend a `Base` class. The `Base` class provides a number of useful properties for the classes extending it. These include the a root directory, the NPM dependencies used, and an `fs` property which should be used for all `FileSystem` related operations.

## Core

Important classes to highlight here are `TargetRuntime` and `TargetBuilder`. In the context of sewing-kit, a _target_ refers to the build output for a given [`Project`](#project).

### TargetRuntime

The `TargetRuntime` class contains information about the runtime for a build target (eg. Does the build run in a Node.js or browser runtime?). This class provides a static utility, `TargetRuntime.fromProject`, to generate the TargetRuntime for a given `Project`.

### TargetBuilder

This class is foundational to how sewing-kit generates build outputs for a given project. It's heavily used by the `sewing-kit build` CLI command. This class can also be used to plugin authors to generate custom build outputs (eg. multi-browser and multi-locale builds).

## Installation

```sh
yarn add @sewing-kit/core --dev
```
npm package: @sewing-kit/eslint-plugin
Description: This plugin has been depreacted please use [`@shopify/eslint-plugin`](https://github.com/Shopify/web-configs/tree/main/packages/eslint-plugin)
Latest version: 0.0.17
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# We've Moved

This plugin has been depreacted please use [`@shopify/eslint-plugin`](https://github.com/Shopify/web-configs/tree/main/packages/eslint-plugin)
npm package: @sewing-kit/plugin-babel
Description: sewing-kit-next technology plugin for babel
Author: Shopify Inc.
Latest version: 0.2.0
Deprecated: This package is deprecated. Please migrate to @shopify/loom-plugin-babel

# `@sewing-kit/plugin-babel`

Exposes hooks to configure [Babel](https://babeljs.io), which may then be used by other build and test plugins.

## Installation

```sh
yarn add @sewing-kit/plugin-babel --dev
```

## Usage

`babel()` is a plugin that exposes hooks to configure babel at the project level and sets default values for that configuration based on what the user provides.

Add the plugin to your project and specify any defaults that you wish to set using the `config` option, which is either an object containing all the options described on [Babel's options page](https://babeljs.io/docs/en/options) with the exception of `include` and `exclude`, or a function that accepts the existing babel options and expects the new babel options object to be returned. This example defines a `config` that uses the `@shopify/babel-preset` preset.

```js
import {createPackage, Runtime} from '@sewing-kit/core';
import {babel} from '@sewing-kit/plugin-babel';

export default createPackage((pkg) => {
  pkg.runtime(Runtime.Node);
  pkg.use(
    babel({
      // Overrides any current config that is set
      config: {presets: ['@shopify/babel-preset']},
    }),
  );
});
```

```js
import {createPackage, Runtime} from '@sewing-kit/core';
import {babel} from '@sewing-kit/plugin-babel';

export default createPackage((pkg) => {
  pkg.runtime(Runtime.Node);
  pkg.use(
    babel({
      // Modifies any current config that has been set by other sewing-kit plugins
      config(babelConfig) {
        // the plugins array may not be set initially
        if (!babelConfig.plugins) {
          babelConfig.plugins = [];
        }
        babelConfig.plugins.push('my-custom-babel-plugin');
        return babelConfig;
      },
    }),
  );
});
```

### Hooks

This plugin adds the following hooks to each of the `TestProjectConfigurationHooks`, `BuildProjectConfigurationHooks`, and `DevProjectConfigurationHooks`:

- `babelConfig`: the configuration used when transpiling with Babel.

  ```js
  import {createProjectBuildPlugin} from '@sewing-kit/core';

  const plugin = createProjectBuildPlugin(({hooks}) => {
    hooks.configure.hook((configure) => {
      // Add an additional plugins when building
      configure.babelConfig?.hook((config) => ({
        ...config,
        plugins: [...config.plugins, require.resolve('my-babel-plugin')],
      }));
    });
  });
  ```
npm package: @sewing-kit/plugin-build-library
Description: sewing-kit-next technology plugin for building libraries
Author: Shopify Inc.
Latest version: 0.2.0
Deprecated: This package is deprecated. Please migrate to @shopify/loom-plugin-build-library

# `@sewing-kit/plugin-build-library`

Exposes two plugins (`buildLibrary`, `buildLibraryWorkspace`) for off-the-shelf library building within `sewing-kit-next`.

## Installation

```sh
$ yarn add @sewing-kit/plugin-build-library --dev
```

## Usage

Add `buildLibrary` and `buildLibraryWorkspace` to your sewing-kit plugins.

```js
import {createPackage, Runtime} from '@sewing-kit/core';
import {
  buildLibrary,
  buildLibraryWorkspace,
} from '@sewing-kit/plugin-build-library';

export default createPackage((pkg) => {
  pkg.runtimes(Runtime.Node, Runtime.Browser);
  pkg.entry({root: './src/index'});
  pkg.use(
    buildLibrary({
      // Required. A browserslist string that shall be targeted when your runtime includes `Runtime.Browser`
      browserTargets: 'defaults',
      // Required. A browserslist string that shall be targeted when your runtime includes `Runtime.Node`
      nodeTargets: 'node 12.13',
      // Optional. Defaults to false. Defines if graphql files should be processed.
      graphql: false,
      // Optional. Defaults to 'node'. Defines if the jest environment should be 'node' or 'jsdom'.
      jestEnvironment = 'node',
      // Optional. Defaults to empty object. Defines any additional config to pass to plugin-package-build
      packageBuildOptions: {}
    }),
    buildLibraryWorkspace({
      // Optional. Defaults to false. Defines if d.ts files should be generated for graphql files.
      graphql: false,
    }),
  );
});
```

### Overriding Babel config

We provide an initial babel config that supports typescript and react, using `@shopify/babel-plugin`. If you need to adjust this config, you can call the `babel()` plugin after `buildLibrary` to override the defaults.

```js
import {createPackage, Runtime} from '@sewing-kit/core';
import {
  buildLibrary,
  buildLibraryWorkspace,
  babel,
} from '@sewing-kit/plugin-build-library';

export default createPackage((pkg) => {
  pkg.runtimes(Runtime.Node, Runtime.Browser);
  pkg.entry({root: './src/index'});
  pkg.use(
    buildLibrary({
      browserTargets: 'defaults',
      nodeTargets: 'node 12.13',
    }),
    buildLibraryWorkspace({
      // Optional. Defaults to false. Defines if d.ts files should be generated for graphql files.
      graphql: false,
    }),
    babel({
      config(babelConfig) {
        // the plugins array may not be set initially
        if (!babelConfig.plugins) {
          babelConfig.plugins = [];
        }
        babelConfig.plugins.push('my-custom-babel-plugin');
        return babelConfig;
      },
    }),
  );
});
```

### Assumptions

- `@svgr/rollup` will look up svgs under `**/icons/*.svg`, and convert them to functional React components.
- `@rollup/plugin-image` will look for images not under `**/icons/*.svg` and convert them to data uris.
npm package: @sewing-kit/plugin-css
Description: sewing-kit-next technology plugin for CSS
Author: Shopify Inc.
Latest version: 0.3.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@sewing-kit/plugin-css`

This package has been removed. Per technology and partial config plugins have been removed as we do not believe they are the right abstraction.
npm package: @sewing-kit/plugin-differential-serving
Description: sewing-kit-next plugin for differential serving
Author: Shopify Inc.
Latest version: 0.3.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@sewing-kit/plugin-differential-serving`

This package has been removed. Per technology and partial config plugins have been removed as we do not believe they are the right abstraction.
npm package: @sewing-kit/plugin-eslint
Description: sewing-kit-next plugin for linting with eslint
Author: Shopify Inc.
Latest version: 0.4.4
Deprecated: This package is deprecated. Please migrate to @shopify/loom-plugin-eslint

# `@sewing-kit/plugin-eslint`

This package provides a `sewing-kit` plugin that runs [ESLint](https://eslint.org) as part of the [`sewing-kit lint` command](TODO).

## Installation

```sh
yarn add @sewing-kit/plugin-eslint --dev
```

## `eslint()`

The `eslint` function returns a `sewing-kit` plugin. This plugin applies to the workspace, not an individual project.

```js
import {createWorkspace} from '@sewing-kit/core';
import {eslint} from '@sewing-kit/plugin-eslint';

export default createWorkspace((workspace) => {
  workspace.use(eslint());
});
```

By default ESLint runs over everything in the current folder. You can modify the files that are processed by passing in a `files` glob to the plugin's options.

```js
export default createWorkspace((workspace) => {
  // Run eslint on a single subfolder
  workspace.use(pretttier({files: 'some-subfolder/**/*'}));
});
```

### Hooks

This plugin adds the following hooks to `LintWorkspaceConfigurationCustomHooks`:

- `eslintFlags`: an object of options to convert into command line flags for the `eslint` command. These options are camelcase versions of their [CLI counterparts](https://eslint.org/docs/user-guide/command-line-interface).

  ```js
  import {createWorkspaceLintPlugin} from '@sewing-kit/core';

  const plugin = createWorkspaceLintPlugin(({hooks}) => {
    hooks.configure.hook((configure) => {
      // Modify the maximum number of allowed warnings from the default of 0
      configure.eslintFlags?.hook((flags) => ({
        ...flags,
        maxWarnings: 5,
      }));
    });
  });
  ```
npm package: @sewing-kit/plugin-graphql
Description: sewing-kit-next technology plugin for graphql
Author: Shopify Inc.
Latest version: 0.3.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@sewing-kit/plugin-graphql`

This package has been removed. Per technology and partial config plugins have been removed as we do not believe they are the right abstraction.
npm package: @sewing-kit/plugin-javascript
Description: sewing-kit-next technology plugin for javascript
Author: Shopify Inc.
Latest version: 0.7.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@sewing-kit/plugin-javascript`

This package has been deprecated, and replaced by `plugin-babel`, which forces you to be explicit in your babel configuration, rather than providing a built-in babel config. We recommend using `@shopify/babel-preset` as a base babel config.
npm package: @sewing-kit/plugin-package-flexible-outputs
Description: sewing-kit-next plugin for consuming esmodule and esnext output
Author: Shopify Inc.
Latest version: 0.3.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@sewing-kit/plugin-package-flexible-outputs`

This package has been removed. Per technology and partial config plugins have been removed as we do not believe they are the right abstraction.
npm package: @sewing-kit/plugin-prettier
Description: sewing-kit-next plugin for linting with prettier
Author: Shopify Inc.
Latest version: 0.1.4
Deprecated: This package is deprecated. Please migrate to @shopify/loom-plugin-prettier

# `@sewing-kit/plugin-prettier`

This package provides a `sewing-kit` plugin that runs [Prettier](https://prettier.io) as part of the [`sewing-kit lint` command](TODO).

## Installation

```sh
yarn add @sewing-kit/plugin-prettier --dev
```

## `prettier()`

The `prettier` function returns a `sewing-kit` plugin. This plugin applies to the workspace, not an individual project.

```js
import {createWorkspace} from '@sewing-kit/core';
import {prettier} from '@sewing-kit/plugin-prettier';

export default createWorkspace((workspace) => {
  workspace.use(prettier());
});
```

By default prettier runs over everything in the current folder. You can modify the files that are processed by passing in a `files` glob to the plugin's options. This is useful if you use `eslint-plugin-prettier` or `stylelint-prettier` to run prettier as part of `eslint` or `stylelint` as there is no point to running prettier over those files twice.

```js
export default createWorkspace((workspace) => {
  // Run prettier on md, json, yaml and yml files
  workspace.use(prettier({files: '**/*.{md,json,yaml,yml}'}));
});
```

### Hooks

This plugin adds the following hooks to `LintWorkspaceConfigurationCustomHooks`:

- `prettierFlags`: an object of options to convert into command line flags for the `prettier` command. These options are camelcase versions of their [CLI counterparts](https://prettier.io/docs/en/cli.html).

  ```js
  import {createWorkspaceLintPlugin} from '@sewing-kit/core';

  const plugin = createWorkspaceLintPlugin(({hooks}) => {
    hooks.configure.hook((configure) => {
      // Trigger error when encountering unknown files matched by patterns
      configure.prettierFlags?.hook((flags) => ({
        ...flags,
        ignoreUnknown: false,
      }));
    });
  });
  ```
npm package: @sewing-kit/plugin-react
Description: sewing-kit-next technoology plugin for react
Author: Shopify Inc.
Latest version: 0.3.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@sewing-kit/plugin-react`

This package has been removed. Per technology and partial config plugins have been removed as we do not believe they are the right abstraction.
npm package: @sewing-kit/plugin-sass
Description: sewing-kit-next technology plugin for sass
Author: Shopify Inc.
Latest version: 0.3.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@sewing-kit/plugin-sass`

This package has been removed. Per technology and partial config plugins have been removed as we do not believe they are the right abstraction.
npm package: @sewing-kit/plugin-service-base
Description: sewing-kit-next plugin for services
Author: Shopify Inc.
Latest version: 0.3.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@sewing-kit/plugin-service-base`

This package has been removed. Per technology and partial config plugins have been removed as we do not believe they are the right abstraction.
npm package: @sewing-kit/plugin-stylelint
Description: sewing-kit-next plugin for linting with stylelint
Author: Shopify Inc.
Latest version: 0.4.4
Deprecated: This package is deprecated. Please migrate to @shopify/loom-plugin-stylelint

# `@sewing-kit/plugin-stylelint`

This package provides a `sewing-kit` plugin that runs [stylelint](https://stylelint.io) as part of the [`sewing-kit lint` command](TODO).

## Installation

```sh
yarn add @sewing-kit/plugin-stylelint --dev
```

## `stylelint()`

The `stylelint` function returns a `sewing-kit` plugin. This plugin applies to the workspace, not an individual project.

```js
import {createWorkspace} from '@sewing-kit/core';
import {stylelint} from '@sewing-kit/plugin-stylelint';

export default createWorkspace((workspace) => {
  workspace.use(stylelint());
});
```

By default stylelint runs over css files. You can modify the files that are processed by passing in a `files` glob to the plugin's options.

```js
export default createWorkspace((workspace) => {
  // Run stylelint on css and scss files
  workspace.use(stylelint({files: '**/*.{css,scss}'}));
});
```

### Hooks

This plugin adds the following hooks to `LintWorkspaceConfigurationCustomHooks`:

- `stylelintFlags`: an object of options to convert into command line flags for the `eslint` command. These options are camelcase versions of their [CLI counterparts](https://stylelint.io/user-guide/usage/cli/).

  ```js
  import {createWorkspaceLintPlugin} from '@sewing-kit/core';

  const plugin = createWorkspaceLintPlugin(({hooks}) => {
    hooks.configure.hook((configure) => {
      // Modify the maximum number of allowed warnings from the default of 0
      configure.stylelintFlags?.hook((flags) => ({
        ...flags,
        maxWarnings: 5,
      }));
    });
  });
  ```
npm package: @sewing-kit/plugin-vscode
Description: sewing-kit-next plugin for vscode
Author: Shopify Inc.
Latest version: 0.3.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@sewing-kit/plugin-vscode`

This package has been removed. Per technology and partial config plugins have been removed as we do not believe they are the right abstraction.
npm package: @sewing-kit/plugin-web-app-base
Description: sewing-kit-next plugin for web apps
Author: Shopify Inc.
Latest version: 0.3.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@sewing-kit/plugin-web-app-base`

This package has been removed. Per technology and partial config plugins have been removed as we do not believe they are the right abstraction.
npm package: @sewing-kit/plugin-webpack-builds
Description: sewing-kit-next plugin for webpack builds
Author: Shopify Inc.
Latest version: 0.3.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@sewing-kit/plugin-webpack-builds`

This package has been removed. Per technology and partial config plugins have been removed as we do not believe they are the right abstraction.
npm package: @sewing-kit/webpack-plugin-hash-output
Description: A webpack plugin for hash output
Author: Shopify Inc.
Latest version: 0.3.0
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# `@sewing-kit/webpack-plugin-hash-output`

This package has been deprecated. Its functionality is now part of `@sewing-kit/plugin-webpack`.
npm package: @sewjs/core
Description: SewJs Core
Author: Dominic Vonk
Latest version: 0.0.3

# SewJs

## Installation
```sh
npm install @sewjs/core
```

## Usage

### NPM
```js
const SewJs = require('@sewjs/core');
```

\- or -

### In Browser
```html
<script src="https://unpkg.com/@sewjs/core"></script>
```

## API reference

### Initializing
```js
var sewjs = new SewJs();
```

### Getter
```js
sewjs.variable
```

### Setter
```js
sewjs.variable = value
```

### Link
```js
var dummyObject = {};
sewjs.link('variable',
dummyObject, /* parent object */
'newVariable', /* variable in parent object */
/* transform value function returning the new value (optional) */);
```
\- or -

```js
var dummyObject = {};
sewjs.link('variable',
 /* callback */
function(value) {
    this.classList.add(value)
},
document.querySelector('body'), /* destination  (optional) */
/* transform value function returning the new value (optional) */);
```


### Unlink
```js
var dummyObject = {};
sewjs.unlink('variable',
dummyObject, /* parent object (optional) */
'newVariable' /* variable in parent object (optional) */);
```
\- or -

```js
var dummyObject = {};
sewjs.unlink('variable',
 /* callback (optional) */
function(value) {
    this.classList.add(value)
},
document.querySelector('body') /* destination (optional) */);
```
npm package: @sex-pomelo/pomelo-coderx
Description: pomelo protocol performance 
Author: shudingbo@qq.com
Latest version: 0.0.1

# pomelo-coderx
Pomelo protocol coder accelerate performance

## Install
`npm install --save-optional @sex-pomelo/pomelo-coderx`

## Function
 
 * Implement Pomelo protocol Message.encode Performance optimization.
   - The route string must is `[a-zA-Z0-9\.-_]`