# @shopify/loom

> The core data models for loom

Latest version **1.0.2** (published 2022-08-23) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @shopify/loom
pnpm add @shopify/loom
yarn add @shopify/loom
bun add @shopify/loom
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2022-08-23 |
| First published | 2021-09-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^12.22.0 \|\| ^14.17.0 \|\| >=16.0.0 |
| Dependencies | 8 |
| Unpacked size | 128.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shopify Inc. |
| Maintainers | wcandillon, jplhomer, marytal, themallen, nathanpjf, shopify-dep, goodforonefare, lemonmade, vsumner, wizardlyhel, antoine.grant, tsov, andyw8-shopify, henrytao, hannachen, andrewapperley, iainmcampbell, vividviolet, bpscott |

## Links

- npm: https://www.npmjs.com/package/@shopify/loom
- Repository: https://github.com/Shopify/loom
- Homepage: https://github.com/Shopify/loom/blob/main/packages/loom/README.md
- Issues: https://github.com/Shopify/loom/issues
- npm.io page: https://npm.io/package/@shopify/loom

## Dependencies (8)

- [glob](https://npm.io/package/glob.md) ^7.1.6
- [fs-extra](https://npm.io/package/fs-extra.md) ^9.0.0
- [@types/glob](https://npm.io/package/@types/glob.md) ^7.1.1
- [change-case](https://npm.io/package/change-case.md) ^4.1.0
- [@babel/register](https://npm.io/package/@babel/register.md) ^7.14.5
- [@types/fs-extra](https://npm.io/package/@types/fs-extra.md) ^9.0.0
- [@babel/preset-env](https://npm.io/package/@babel/preset-env.md) ^7.14.5
- [@babel/preset-typescript](https://npm.io/package/@babel/preset-typescript.md) ^7.14.5

## Recent versions

- 1.0.2 (latest) — 2022-08-23
- 0.8.0-alpha.0 (beta) — 2021-10-12
- 1.0.1 — 2021-11-23
- 1.0.0 — 2021-10-22
- 0.8.0-alpha.4 — 2021-10-15
- 0.8.0-alpha.3 — 2021-10-15
- 0.8.0-alpha.2 — 2021-10-15
- 0.8.0-alpha.1 — 2021-10-13
- 0.7.0 — 2021-09-13

## README

# `@shopify/loom`

## Modeling

Loom 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 loom, 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 loom generates build outputs for a given project. It's heavily used by the `loom 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 @shopify/loom --dev
```

---
_Source: https://npm.io/package/@shopify/loom · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
