open-index/open-npm huggingface dataset:
npm package: @matthamlin/ast-crawler
Description: Two small utilities for generating an AST Map (mapping of file paths to ast for their contents) and for visiting each of those entries in the AST Map.
Author: Matt Hamlin
Latest version: 0.0.3

# AST Crawler

Two small utilities for generating an AST Map (mapping of file paths to ast for
their contents) and for visiting each of those entries in the AST Map.

## Installation:

```sh
yarn add @matthamlin/ast-crawler
```

## Usage:

```tsx
import { generateASTMap, visit, find } from '@matthamlin/ast-crawler'

// Implementing a local cache for parsers
import { parse } from '@babel/parser'
import path from 'path'

let parsers = {}

function createParser(filepath) {
  let extension = path.extname(filepath)
  if (parsers[extension]) {
    return parsers[extension]
  }
  if (extension === '.tsx' || extension === '.ts') {
    parsers['.ts'] = parsers['.tsx'] = (contents) => {
      return parse(contents, {
        plugins: ['typescript'],
        sourceType: 'module',
      })
    }
    return parsers['.ts']
  } else {
    parsers[extension] = (contents) => {
      return parse(contents, {
        plugins: ['flow'],
        sourceType: 'module',
      })
    }
    return parsers[extension]
  }
}

let astMap = generateASTMap({
  files: find({ root: path.join('./src'), extensions: ['.js', '.ts', '.tsx'] }),
  createParser,
})

function visitor({ ast, path: filePath }) {
  // do whatever you want here with the ast and the filepath
}

visit({
  visitor,
  astMap,
})
```

### Tools:

- Typescript
- Babel
- Jest

### TODO:

- [ ] Refine `AST` type
npm package: @matthamlin/babel-config
Description: A shared babel config for packages in the Projects repo.
Author: Matthew Hamlin
Latest version: 1.1.0

# `@matthamlin/babel-config`

A shared babel config for packages in the Projects repo.

## API

```js
let babelConfig = require('@matthamlin/babel-config')

module.exports = babelConfig({
  // if the config should compile for node LTS or not, defaults to false
  node: true,
  // if the config should preserve the esmodule output or not, defaults to false
  esmodules: true,
})
```

## Included:

### Plugins:

- `@babel/plugin-transform-runtime`
- `babel-plugin-styled-components`
- `@babel/plugin-proposal-class-properties`
- `@babel/plugin-proposal-export-namespace-from`
- `@babel/plugin-proposal-object-rest-spread`

### Presets:

- `@babel/preset-env`
- `@babel/preset-react`
npm package: @matthamlin/babel-parser-bundle
Description: A compiled esmodule of `@babel/parser` - available for imports in the browser or elsewhere.
Author: Matthew Hamlin
Latest version: 1.0.1

# `@matthamlin/babel-parser-bundle`

A compiled esmodule of `@babel/parser` - available for imports in the browser or
elsewhere.

Versioning:

| This Library Version | @babel/parser version |
| -------------------- | --------------------- |
| `1.0.1`              | `7.9.4`               |

## API

Same API as `@babel/parser`
npm package: @matthamlin/base-styled
Description: A base React component that removes style props from `styled-system`.
Author: Matthew Hamlin
Latest version: 1.2.0

# `@matthamlin/base-styled`

A base React component that removes style props from `styled-system`.

## API

```jsx
import Base from '@matthamlin/base-styled'
import { compose, space, border, color, flexbox } from 'styled-system'

let Box = styled(Base)(compose(space, border, color, flexbox))
```

## Note:

If you create a higher-order `Box` component based off of this component, you should only ever use `forwardedAs` and not `as` when using `styled-components` to ensure that this component is rendered
npm package: @matthamlin/danger-react-suspense
Description: This is a custom build of React that has a few additional feature flags enabled, most notable suspense.
Author: Matthew Hamlin
Latest version: 2.0.0

# danger-react-suspense

This is a custom build of React that has a few additional feature flags enabled, most notable suspense.

## How to build:

1. Update local fork of react with master
2. Edit flags in `shared/ReactFeatureFlag.js`
3. `yarn build` (make sure java is set up locally 🤯)
4. Copy over files from the built locations to `build/`, `dev/` and `prod/` dropping the prefixes as needed.
5. Make sure to edit local `require` calls to local ones instead of non-local versions!!
6. `yarn publish`
npm package: @matthamlin/ds
Description: 👻
Author: Matthew Hamlin
Latest version: 4.0.0

# DS

DS is a simple node script to build out a json config file for css-in-js design systems. It consumes three paths to:

* `colors.js`
* `fonts.js`
* `numbers.js`

and then generates a json string representation of the design system.

## Use:

```Javascript
import ds from '@matthamlin/ds';

const stringifiedJSON = ds({
  fonts: require('path/to/fonts.js'),
  colors: require('path/to/colors.js'),
  numbers: require('path/to/numbers.js')
});

// fs.writeFile('./out.json', stringifiedJSON);
// JSON.parse(stringifiedJSON);
```

### What does it look like?

To see an example of this in action, clone the repo, run `yarn` then `yarn make-example` and see `./example/out.json` file generated.


### Prior Art:

* [design-system-utils](https://github.com/mrmartineau/design-system-utils)
npm package: @matthamlin/error-boundary
Description: A generic ErrorBoundry component.
Author: Matthew Hamlin
Latest version: 1.0.1

# `@matthamlin/error-boundary`

A generic ErrorBoundry component.

## API

```jsx
import ErrorBoundary from '@matthamlin/error-boundary'

function Fallback({ error }) {
  // render fallback UI
}

render(
  <ErrorBoundary Fallback={Fallback} onError={err => logErr(err)}>
    <App />
  </ErrorBoundary>,
)
```

The default export of the library exposes an `ErrorBoundary` component that
supports the following props:

- `children` - The React tree that may throw an error
- `Fallback` - A React component to render when an error is caught
- `onError` - A callback prop called when an error is caught