open-index/open-npm huggingface dataset:
npm package: @jvalue/jayvee-interpreter
Description: Interpreter for .jv files
Latest version: 0.6.4

<!--
SPDX-FileCopyrightText: 2023 Friedrich-Alexander-Universitat Erlangen-Nurnberg

SPDX-License-Identifier: AGPL-3.0-only
-->

# Interpreter

## Run the interpreter locally

Build the interpreter:

```console
npx nx run interpreter:build
```

See [Usage](#usage) for how to use the interpreter. Replace `jv` with `node dist/apps/interpreter/main.js` when running the commands.

## Global installation

See the [official docs](https://jvalue.github.io/jayvee).


## Important project files

- `package.json` - used for publishing the interpreter as npm package.
- `src/index.ts` - the entry point of the command line interface (CLI).
npm package: @jvalue/jayvee-interpreter-lib
Description: <!-- SPDX-FileCopyrightText: 2023 Friedrich-Alexander-Universitat Erlangen-Nurnberg
Latest version: 0.6.4

<!--
SPDX-FileCopyrightText: 2023 Friedrich-Alexander-Universitat Erlangen-Nurnberg

SPDX-License-Identifier: AGPL-3.0-only
-->

# Jayvee interpreter Library

This library can be used to interpret a Jayvee model. For example, the [interpreter app](/apps/interpreter/) uses this library after parsing the command line input.

## Example Usage

For interpreting a string, you can simply use the method 
```javascript
interpretString(
  modelString,  // string
  options,      // RunOptions
)
```

If you want to interpret anything else, you need to define a function that instantiates the `JayveeModel`, e.g., from a file: 
```javascript
const extractAstNodeFn = async (
    services: JayveeServices,
    loggerFactory: LoggerFactory,
  ) =>
    await extractAstNodeFromFile<JayveeModel>(
        fileName,
        services,
        loggerFactory.createLogger(),
    );
const exitCode = await interpretModel(extractAstNodeFn, options);
```

## Building

Run `nx build interpreter-lib` to build the library.

## Running unit tests

Run `nx test interpreter-lib` to execute the unit tests via [vitest](https://vitest.dev).
npm package: @jvalue/jayvee-language-server
Description: <!-- SPDX-FileCopyrightText: 2023 Friedrich-Alexander-Universitat Erlangen-Nurnberg
Latest version: 0.6.4

<!--
SPDX-FileCopyrightText: 2023 Friedrich-Alexander-Universitat Erlangen-Nurnberg

SPDX-License-Identifier: AGPL-3.0-only
-->

# Language Server

## Important project files

- `language-configuration.json` - the language configuration used in monaco editors, defining the tokens that are used for comments and brackets.
- `src/grammar/` - a folder containing the grammar definition of the language.
- `langium-config.json` - the configuration for the Langium generator.

## FAQ

### Why is the linting rule `@typescript-eslint/no-unnecessary-condition` sometimes disabled?

The rule is disabled in places, where we work with potentially incomplete AST nodes.

Langium generates separate interfaces for each kind of AST node.
According to the generated interfaces, their properties are never `undefined` but in reality they might be.

So, in order to write safe code, we need to handle those cases where properties may be `undefined` and thus use 
conditions for checking the actual value against `undefined`.
ESLint considers such conditions unnecessary (due to the interfaces), which is the reason for disabling that particular 
rule.
npm package: @jvalue/jayvee-language-server-web-worker
Description: <!-- SPDX-FileCopyrightText: 2023 Friedrich-Alexander-Universitat Erlangen-Nurnberg
Latest version: 0.6.4

<!--
SPDX-FileCopyrightText: 2023 Friedrich-Alexander-Universitat Erlangen-Nurnberg

SPDX-License-Identifier: AGPL-3.0-only
-->

# Language server Web Worker

Instantiates a Jayvee language server that is meant to run in a [Web Worker](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API). It can be used together with the 
[monaco editor](../../libs/monaco-editor) to edit Jayvee files in a browser. Have a look at the [documentation](../../libs/monaco-editor/README.md) of the monaco editor for 
details on how to set them up together.