open-index/open-npm huggingface dataset:
npm package: @notionhq/contentful-typescript-codegen
Description: Generate TypeScript types from your Contentful environment.
Author: Steven Petryk
Latest version: 0.0.0-development

# contentful-typescript-codegen

Generate typings from your Contentful environment.

- Content Types become interfaces.
- Locales (and your default locale) become string types.
- Assets and Rich Text link to Contentful's types.

At Intercom, we use this in our [website] to increase developer confidence and productivity,
ensure that breaking changes to our Content Types don't cause an outage, and because it's neat.

[website]: https://www.intercom.com

## Usage

```sh
yarn add --dev contentful-typescript-codegen
```

Then, add the following to your `package.json`:

```jsonc
{
  // ...
  "scripts": {
    "contentful-typescript-codegen": "contentful-typescript-codegen --output @types/generated/contentful.d.ts"
  }
}
```

Feel free to change the output path to whatever you like.

Next, the codegen will expect you to have created a file called `getContentfulEnvironment.js` in the
root of your project directory, and it should export a promise that resolves with your Contentful
environment.

The reason for this is that you can do whatever you like to set up your Contentful Management
Client. Here's an example:

```js
const contentfulManagement = require("contentful-management")

module.exports = function() {
  const contentfulClient = contentfulManagement.createClient({
    accessToken: process.env.CONTENTFUL_MANAGEMENT_API_ACCESS_TOKEN,
  })

  return contentfulClient
    .getSpace(process.env.CONTENTFUL_SPACE_ID)
    .then(space => space.getEnvironment(process.env.CONTENTFUL_ENVIRONMENT))
}
```

### Command line options

```
Usage
  $ contentful-typescript-codegen --output <file> <options>

Options
  --output,      -o  Where to write to
  --poll,        -p  Continuously refresh types
  --interval N,  -i  The interval in seconds at which to poll (defaults to 15)
```

## Example output

Here's an idea of what the output will look like for a Content Type:

```ts
interface IBlogPostFields {
  /** Title */
  title: string

  /** Body */
  body: Document

  /** Author link */
  author: IAuthor

  /** Image */
  image: Asset

  /** Published? */
  published: boolean | null

  /** Tags */
  tags: string[]

  /** Blog CTA variant */
  ctaVariant: "new-cta" | "old-cta"
}

/**
 * A blog post.
 */
export interface IBlogPost extends Entry<IBlogPostFields> {}
```

You can see that a few things are handled for you:

- Documentation comments are automatically generated from Contentful descriptions.
- Links, like `author`, are resolved to other TypeScript interfaces.
- Assets are handled properly.
- Validations on symbols and text fields are expanded to unions.
- Non-required attributes automatically have `| null` appended to their type.
- The output is formatted using **your** Prettier config.
npm package: @notionhq/workers
Description: An SDK for building workers for the Notion Workers platform
Latest version: 0.2.0

# Workers SDK

## Development

1. Install [mise](https://mise.jdx.dev/getting-started.html)
2. Run `mise install`
3. Run `npm run bootstrap`

## Publishing New Versions

Increment the package.json version and create a new Git tag:

```shell
# This also creates a Git tag.
npm version patch
```

Then, push the commit and tag:

```shell
git push origin main --follow-tags
```
npm package: @notiv/env-config
Description: Loads global configurations for client and server from root directory
Latest version: 1.0.0

# @dicehub/config-env-loader

[![npm version](https://badge.fury.io/js/%40dicehub%2Fconfig-env-loader.svg)](https://badge.fury.io/js/%40dicehub%2Fconfig-env-loader)

> Load configuration files based on `NODE_ENV` variable

## Install

```
npm install @dicehub/config-env-loader -S

# via yarn
yarn add @dicehub/config-env-loader
```

## Usage


### Set NODE_ENV
Only the file that corresponds to the `NODE_ENV` variable will be included
```bash
$ export NODE_ENV=development
```


### Create configuration file config/**development**.yaml:

```yaml
# <root>/config/development.yaml

TEST_VAR: 20
```


### Include the plugin in your entry file

```js
// <root>/index.js

require('@dicehub/config-env-loader')({
  // Config directory
  configPath: './config/',
});
```

And now, every variable that is in the file `config/development.yaml` is available through the `process.env`

```js
console.log(process.env.DEVELOPMENT_ENV_VAR) // '42';
```

The value is string because [https://nodejs.org/dist/latest-v10.x/docs/api/process.html#process_process_env](https://nodejs.org/dist/latest-v10.x/docs/api/process.html#process_process_env)

## Options:

```js
var conf = require('@dicehub/config-env-loader')({
  // The directory where the configuration files for the NODE_ENV are located
  configPath: './config/',

  // The array of files to be included, not depending on the NODE_ENV
  include: ['./common-config.yaml']
});

// The variable conf contains all that is included
// Except that the types are not converted
process.env.TEST_VAR // '42'
conf.TEST_VAR // 42
```

## Default config file

1) By default, if NODE_ENV is not provided, the configuration development.yaml is loaded
2) if in config folder there is a file `general.yaml` then it will be loaded before the `{NODE_ENV}.yaml`