# graphql-santa

Latest version **0.3.0** (published 2020-01-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install graphql-santa
pnpm add graphql-santa
yarn add graphql-santa
bun add graphql-santa
```

Provides the commands `santa`, `graphql-santa`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2020-01-26 |
| First published | 2019-12-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 27 |
| Unpacked size | 682.2 KB |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 667 |
| Author | Prisma Labs |
| Maintainers | jasonkuhrt |

## Links

- npm: https://www.npmjs.com/package/graphql-santa
- Repository: https://github.com/prisma-labs/graphql-santa
- Issues: https://github.com/prisma-labs/graphql-santa/issues
- npm.io page: https://npm.io/package/graphql-santa

## Dependencies (27)

- [arg](https://npm.io/package/arg.md) ^4.1.1
- [pino](https://npm.io/package/pino.md) ^5.15.0
- [chalk](https://npm.io/package/chalk.md) ^3.0.0
- [debug](https://npm.io/package/debug.md) ^4.1.1
- [nexus](https://npm.io/package/nexus.md) ^0.12.0-rc.5
- [tslib](https://npm.io/package/tslib.md) ^1
- [dotenv](https://npm.io/package/dotenv.md) ^8.2.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [express](https://npm.io/package/express.md) ^4.17.1
- [graphql](https://npm.io/package/graphql.md) ^14.5.8
- [prompts](https://npm.io/package/prompts.md) ^2.3.0
- [ts-node](https://npm.io/package/ts-node.md) ^8.5.0
- [anymatch](https://npm.io/package/anymatch.md) ^3.1.1
- [chokidar](https://npm.io/package/chokidar.md) ^3.3.0
- [codename](https://npm.io/package/codename.md) ^0.0.6
- [get-port](https://npm.io/package/get-port.md) ^5.1.0
- [tsconfig](https://npm.io/package/tsconfig.md) ^7.0.0
- [tree-kill](https://npm.io/package/tree-kill.md) ^1.2.1
- [fs-jetpack](https://npm.io/package/fs-jetpack.md) ^2.2.3
- [simple-git](https://npm.io/package/simple-git.md) ^1.126.0
- [typescript](https://npm.io/package/typescript.md) ^3.7.2
- [@types/pino](https://npm.io/package/@types/pino.md) ^5.15.1
- [common-tags](https://npm.io/package/common-tags.md) ^1.8.0
- [@types/debug](https://npm.io/package/@types/debug.md) ^4.1.5
- [@types/express](https://npm.io/package/@types/express.md) ^4.17.2
- [express-graphql](https://npm.io/package/express-graphql.md) ^0.9.0
- [graphql-request](https://npm.io/package/graphql-request.md) ^1.8.2

## Recent versions

- 0.3.0 (latest) — 2020-01-26
- 0.0.0-master.3835cc4 (master) — 2019-12-19
- 0.0.0-pr.201.0664d96 (pr.201) — 2019-12-19
- 0.2.1-next.1 — 2020-01-21
- 0.2.0 — 2020-01-18
- 0.2.0-next.3 — 2020-01-16
- 0.2.0-next.2 — 2020-01-14
- 0.2.0-next.1 — 2020-01-14
- 0.1.2 — 2019-12-19
- 0.1.1 — 2019-12-19
- 0.1.0 — 2019-12-19
- 0.0.0-master.1983f41 — 2019-12-19
- 0.0.0-master.223cf26 — 2019-12-19
- 0.0.0-master.ede0727 — 2019-12-18
- 0.0.0-master.5627ee2 — 2019-12-18
- … 1 more at https://npm.io/package/graphql-santa/versions

## README

# graphql-santa <!-- omit in toc -->

<br>

## Documentation <!-- omit in toc -->

https://prisma-labs.github.io/graphql-santa

<br>

## Development

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Code Architecture](#code-architecture)
- [Testing](#testing)
- [Releasing](#releasing)
- [Website](#website)
- [Workflow Tips](#workflow-tips)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

<br>

### Code Architecture

#### Overview

- Roughly speaking we have three distinct levels of code:

  1. `src/{cli, framework}` Top level modules coded directly against their respective domain.

  2. `src/utils/*` Mid level modules that might provide some conveniences or encapsulate concerns shared across `framework` and `cli`.

  3. `src/lib/*` Discrete modules that stand alone conceptually and technically.

- Each level builds on the one below it.

- One can think of code as evolving from level 1 down toward level 3.

  Of course the natural place for some code is level 1. On the other hand we often don't know at first what a generic solution looks like. So level 3 tends to be grown into, rather than started from.

- You could see a level 4 here as npm registry, where we _fully_ extract a library. That is not an explicit goal, just a tip for the mental model.

- Overall status of the codebase is in a state of refactoring. `utils`, `watcher`, and more are undergoing source restructuring in the near future.

#### Layout Overview

```
/docs         -- The website
/test         -- Integration tests
/src
  /cli        -- CLI codebase
  /framework  -- Runtime codebase
  /utils      -- Non-discrete modules (may have state, tight coupling)
  /lib        -- Discrete modules
```

#### `lib`

The layout of a typical lib module looks like so:

```
/lib
  /<module-name>
    /index.ts        -- Export-only module, the public interface
    /index.spec.ts   -- Tests against the public interface. Integration in the sense
                        that it is agnostic to the unit or units making up the lib.
    /*.ts            -- The modules making up the lib
    /*.spec.ts       -- Optional tests. Please prioritize `index.spec.ts`
```

Be careful about lib modules depending upon one another excessively. The more complex the dependency graph the harder it _can_ become to reason about the modules. But if there is non-trivial re-use to be had and/or just a simple/clean and logical dependency then go for it.

The built-in exception to this heuristic is `lib/utils` which can be thought of as a bespoke `lodash` for our lib components. Use it for small utilities, which might be shared, are very generic, and are not numerous enough to justify their own dedicated lib module. For example there is a utility to make text span a given length using given pad character.

<br>

### Testing

There are unit tests and integration tests. `yarn test` runs them all. Beware that the integration tests run slowly. `yarn dev:test` runs only unit for this reason. Testing on CI is not yet setup.

#### Unit

```
yarn test:unit
```

We co-locate unit tests with their respective modules. These can be run via `yarn test:unit`.

#### Integration

```
yarn test:integration
```

Integration tests rely on `yarn link`. This means those integration tests cannot work on a machine that has not done `yarn link` inside the root of the cloned repo.

<br>

### Releasing

We use [`dripip`](https://github.com/prisma-labs/dripip) to make releases. CI/CD preview releases are not setup yet.

```
yarn -s release:preview
yarn -s release:stable
```

### Website

- We use [docsifyjs/docsify](https://github.com/docsifyjs/docsify).
- There is no build step
- Commits to master will trigger deployment (via `gh-pages`, no ci/cd on our part)
- Navigation is manually managed in `_sidebar.md`
- Cover page is managed in `_coverpage.md`
- Configuration and significant styling customizations are kept in `index.html`

#### Getting started

1. Install `docsify-cli`

   There is currently [a bug](https://github.com/docsifyjs/docsify-cli/issues/88) with `docsify-cli` requiring the following manual fix after installation. To make this less painful, install globally so you should only have to do this once.

   ```
   yarn global add docsify
   ```

   ```
   vim /usr/local/bin/docsify
   :se ff=unix
   :wq
   ```

2. Boot docs dev to preview your changes locally

   ```
   yarn docs:dev
   ```

<br>

### Workflow Tips

#### Working With Example Apps via Linking

Refer to https://github.com/prisma-labs/graphql-santa-examples

#### Working with create command

In any example you can use this workflow:

```
rm -rf test-create && mcd test-create && ../node_modules/.bin/graphql-santa create
```

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