open-index/open-npm huggingface dataset:
npm package: @platformos/lang-jsonc
Description: JSONC language support for CodeMirror
Author: platformOS
Latest version: 0.0.15

# @platformos/lang-jsonc

[CodeMirror](https://codemirror.net/) 6 Language Support for VS Code's flavour of JSON with Comments. Trailing commas included.

## Usage

```js
import { basicSetup } from 'codemirror';
import { EditorView } from '@codemirror/view';
import { EditorState } from '@codemirror/state';
import { jsonc } from '@platformos/lang-jsonc';

new EditorView({
  parent: document.getElementById('json-editor'),
  state: EditorState.create({
    doc: `
      {
        // this is a comment
        "product": "Apple",

        /* block comment, with trailing comma */
        "price": "1.00$",
      }
    `
    extensions: [
      basicSetup,
      jsonc(),
    ],
  }),
});
```

## Credits

This project includes code from the following repositories. Thank you for your work!

1. [@yettoapp/jsonc](https://github.com/yettoapp/lezer-jsonc)
2. [@lezer/json](https://github.com/lezer-parser/json)
3. [@codemirror/lang-json](https://github.com/codemirror/lang-json)

See [ThirdPartyNotices.txt](../../ThirdPartyNotices.txt) for their licenses.

## License

MIT.
npm package: @platformos/liquid-html-parser
Description: Liquid HTML parser for platformOS
Author: platformOS
Latest version: 0.0.15

<h1 align="center" style="position: relative;" >
  <br>
    <img src="https://github.com/Platform-OS/platformos-tools/blob/master/packages/vscode-extension/images/platformos_logo.png?raw=true" alt="platformOS logo" width="200">
  <br>
  Liquid HTML parser
</h1>

<p align="center">
  <a href="https://www.npmjs.com/package/@platformos/liquid-html-parser"><img src="https://img.shields.io/npm/v/@platformos/liquid-html-parser.svg?sanitize=true" alt="Version"></a>
  <a href="https://github.com/Platform-OS/platformos-tools/blob/master/LICENSE.md"><img src="https://img.shields.io/npm/l/@platformos/liquid-html-parser.svg?sanitize=true" alt="License"></a>
  <a href="https://github.com/Platform-OS/platformos-tools/actions/workflows/ci.yml"><img alt="CI" src="https://github.com/Platform-OS/platformos-tools/actions/workflows/ci.yml/badge.svg"></a>
  <!--
    <a href="https://npmcharts.com/compare/@platformos/liquid-html-parser?minimal=true"><img src="https://img.shields.io/npm/dm/@platformos/prettier-plugin-liquid.svg?sanitize=true" alt="Downloads"></a>
  -->
</p>

This module provides the Liquid HTML parser that powers the prettier plugin, linter and language server for platformOS.

It turns a `.liquid` file contents into an Abstract Syntax Tree (AST) that contains _both_ Liquid and HTML nodes.

## Installation

```bash
# with npm
npm install @platformos/liquid-html-parser

# with yarn
yarn add @platformos/liquid-html-parser
```

## Usage

```ts
import { toLiquidHtmlAST, LiquidHtmlNode, NodeTypes } from '@platformos/prettier-plugin-liquid';

const ast: LiquidHtmlNode = toLiquidHtmlAST(`
<body>
  {% for product in all_products %}
    <img src="{{ product | image_url }}">
  {% endfor %}
</body>
`);
```

## You should know

Because Liquid is very permissive, things like the `name` of an HTML tag may have a surprising type: an array of `LiquidVariableOutput | TextNode`. 

This is because the following use cases are supported by the parser:

```liquid
{% # compound html tag names %}
<tag-{{ name }}>
</tag-{{ name }}>

{% # compound html attribute names %}
<img data-{{ attr_name }}="...">
```

## License

MIT.
npm package: @platformos/platformos-check-browser
Description: This is the Browser wrapper of the runtime-agnostic [`@platformos/platformos-check-common`](https://npm.im/@platformos/platformos-check-common) package. It does not come with batteries included and assumes you know what you're doing.
Author: platformOS
Latest version: 0.0.17

# `@platformos/platformos-check-browser`

This is the Browser wrapper of the runtime-agnostic [`@platformos/platformos-check-common`](https://npm.im/@platformos/platformos-check-common) package. It does not come with batteries included and assumes you know what you're doing.

See the [@platformos/platformos-check-common README](../platformos-check-common) for more details.

## License

MIT.
npm package: @platformos/platformos-check-common
Description: <h1 align="center" style="position: relative;" >   <br>     <img src="https://github.com/Platform-OS/platformos-tools/blob/master/packages/vscode-extension/images/platformos_logo.png?raw=true" alt="platformOS logo" width="200">   <br>   platformOS Check <
Author: platformOS
Latest version: 0.0.17

<h1 align="center" style="position: relative;" >
  <br>
    <img src="https://github.com/Platform-OS/platformos-tools/blob/master/packages/vscode-extension/images/platformos_logo.png?raw=true" alt="platformOS logo" width="200">
  <br>
  platformOS Check
</h1>

<h4 align="center">A linter for platformOS</h4>

platformOS Check helps you follow best practices by analyzing your platformOS files.

platformOS Check is available [to code editors that support the Language Server Protocol](https://github.com/Platform-OS/platformos-tools/wiki).

You may be interested by the sibling modules:

- `@platformos/platformos-check-common`: (you are here) npm module to run checks (runtime agnostic).
- `@platformos/platformos-check-node`: npm module to run checks from a [Node.js ](https://nodejs.org) runtime.
- `@platformos/platformos-check-browser`: npm module to run checks in a Browser.

## Installation

### CLI

platformOS Check is integrated in the [platformOS CLI (pos-cli)](https://github.com/Platform-OS/pos-cli).

```bash
pos-cli check
```

### As a library

There are three libraries:

```
yarn add @platformos/platformos-check-node
yarn add @platformos/platformos-check-common
yarn add @platformos/platformos-check-browser
```

## Usage

### Node

The node version comes with batteries included.

```ts
// simple-cli.ts
import { check } from '@platformos/platformos-check-node';

async function main() {
  const root = process.cwd();
  const offenses = await check(root);
  console.log(offenses);
}

main();
```

### Browser

The browser version is a bit more complex, you need to provide your own implementation of all the dependency injections.

```ts
import { simpleCheck, recommended, Config, Dependencies } from '@platformos/platformos-check-browser';

async function main() {
  const appDesc = {
    'app/views/partials/product-card.liquid': '{{ product | image_url | image_tag }}',
    'app/views/partials/for-loop.liquid': '{% for variant in product.variants %}...{% endfor %}',
  };

  const config: Config = {
    checks: recommended,
    settings: {},
    root: '/',
  };

  const dependencies: Dependencies = {
    // ...
  };

  const offenses = await simpleCheck(appDesc, config, dependencies);

  console.log(offenses);
}

main();
```

## Contributing

See [CONTRIBUTING.md](../../docs/contributing.md).
npm package: @platformos/platformos-check-node
Description: This is the Node.js wrapper of the runtime-agnostic [`@platformos/platformos-check-common`](https://npm.im/@platformos/platformos-check-common) package. It comes with batteries included.
Author: platformOS
Latest version: 0.0.17

# `@platformos/platformos-check-node`

This is the Node.js wrapper of the runtime-agnostic [`@platformos/platformos-check-common`](https://npm.im/@platformos/platformos-check-common) package. It comes with batteries included.

See the [@platformos/platformos-check-common README](../platformos-check-common) for more details.

## License

MIT.
npm package: @platformos/platformos-graph
Description: platformOS App Graph as a data structure
Author: platformOS
Latest version: 0.0.17

<h1 align="center" style="position: relative;" >
  <br>
    <img src="https://github.com/Platform-OS/platformos-tools/blob/master/packages/vscode-extension/images/platformos_logo.png?raw=true" alt="platformOS logo" width="200">
  <br>
  platformOS Graph
</h1>

<h4 align="center">A data structure that represents your platformOS application</h4>

A platformOS Graph is a data structure that spans Liquid, JSON, JavaScript and CSS files.

It has the following interface:

```ts
interface AppGraph {
  rootUri: UriString; // e.g. 'file:/path/to/my-app'
  entryPoints: AppModule[];
  modules: Record<UriString, AppModule>
}
```

An `AppModule` holds _dependencies_ and _references_ of a module. For instance,

```ts
interface LiquidModule {
  uri: UriString;
  type: 'liquid';
  kind: 'layout' | 'partial' | 'page';
  references: Reference[];
  dependencies: Reference[];
}
```

For a module $M$,
- a _reference_ is a backlink to _other_ modules that depend on $M$,
- a _dependency_ is a dependent link on another module.

```ts
interface Reference {
  /* The file that initiated the dependency/reference */
  source: { uri: string, range?: Range };

  /* The file that it points to */
  target: { uri: string, range?: Range };

  type:
    | 'direct'   // e.g. {% render 'child' %}, {{ 'app.js' | asset_url }}, <custom-element>, etc.
    | 'indirect' // e.g. files that loosely depend on another
}
```

See [types.md](./src/types.ts) for more details and [how-it-works.md](./docs/how-it-works.md) for an overview of the algorithm.

## Installation

```bash
npm install @platformos/platformos-graph
```

## Usage

### Through the VS Code extension

The app graph is used by the VS Code extension to power the dependencies, references and dead code features.

### From the CLI

```
Usage:
  platformos-graph <path-to-app-directory>

Example:
  platformos-graph horizon > graph.json
```

### As a library

[See bin/platformos-graph](./bin/platformos-graph) for inspiration.

## Contributing

See [CONTRIBUTING.md](../../docs/contributing.md).
npm package: @platformos/platformos-language-server-browser
Description: This is the Browser wrapper of the runtime-agnostic [`@platformos/platformos-language-server-common`](https://npm.im/@platformos/platformos-language-server-common) package. It does not come with batteries included and assumes you know what you're doing.
Author: platformOS
Latest version: 0.0.17

# `@platformos/platformos-language-server-browser`

This is the Browser wrapper of the runtime-agnostic [`@platformos/platformos-language-server-common`](https://npm.im/@platformos/platformos-language-server-common) package. It does not come with batteries included and assumes you know what you're doing.

Presumably for use in CodeMirror along with [`@platformos/codemirror-language-client`](https://npm.im/@platformos/codemirror-language-client).

See the [@platformos/platformos-language-server-common README](../platformos-language-server-common) for more details.

## License

MIT.
npm package: @platformos/platformos-language-server-node
Description: This is the Node.js wrapper of the runtime-agnostic [`@platformos/platformos-language-server-common`](https://npm.im/@platformos/platformos-language-server-common) package. It comes with batteries included.
Author: platformOS
Latest version: 0.0.17

# `@platformos/platformos-language-server-node`

This is the Node.js wrapper of the runtime-agnostic [`@platformos/platformos-language-server-common`](https://npm.im/@platformos/platformos-language-server-common) package. It comes with batteries included.

See the [@platformos/platformos-language-server-common README](../platformos-language-server-common) for more details.

## License

MIT.