open-index/open-npm huggingface dataset:
npm package: @lernos/validate-guide
Description: Validation tool for lernOS guide structure and content
Author: Bjoern Schotte
Latest version: 1.0.0

# @lernos/validate-guide

Validation tool for lernOS guide structure and content.

## Features

- ✅ Validate guide.yaml structure and required fields
- ✅ Check frontmatter in kata and theory files
- ✅ Verify week numbering (sequential 0-N)
- ✅ Validate internal and external links
- ✅ Language completeness checking
- ✅ CI/CD integration with GitHub Actions
- ✅ Human-readable and JSON output

## Installation

```bash
npm install --save-dev @lernos/validate-guide
```

## Usage

### CLI

```bash
# Validate current directory
npx @lernos/validate-guide

# Validate specific guide
npx @lernos/validate-guide /path/to/guide

# Check external links (slower)
npx @lernos/validate-guide --check-external

# Get JSON output
npx @lernos/validate-guide --json

# Strict mode (warnings as errors)
npx @lernos/validate-guide --strict
```

### Programmatic API

```javascript
import { validateGuide } from '@lernos/validate-guide';

const result = await validateGuide('/path/to/guide', {
  checkExternal: false,
  defaultLangOnly: false,
  continueOnError: true,
  strict: false
});

console.log(result);
// {
//   success: false,
//   errors: [...],
//   warnings: [...],
//   info: [...],
//   exitCode: 2
// }
```

## Documentation

- [Guide Authors Documentation](docs/guide-authors.md)
- [Developers Documentation](docs/developers.md)
- [API Reference](docs/api.md)

## License

MIT

## Repository

https://github.com/BjoernSchotte/lernos-validate-guide
npm package: @leroymerlin/eslint-config-leroymerlin
Description: LeroyMerlin's ESLint config
Author: Leroy Merlin Vostok LLC
Latest version: 1.3.0

### eslint-config-leroymerlin

# LeroyMerlin's ESLint config for Node.js apps

- Requires Node.js `>=14`
- Requires ESLint `>=8`

## Using with Javascript apps

`@leroymerlin/eslint-config-leroymerlin/node/javascript`

### Install & Usage

```bash
npm install --save-dev eslint prettier @leroymerlin/eslint-config-leroymerlin
```

**Note:** It recommends a use of [the "engines" field of package.json](https://docs.npmjs.com/files/package.json#engines). The "engines" field is used by `node/no-unsupported-features/*` rules.

**package.json**

```javascript
{
  /*
    ...
  */

  "engines": {
    "node": "14"
  }
}
```

**.eslintrc.js** (An example)

```javascript
'use strict';

module.exports = {
  root: true,
  extends: ['@leroymerlin/eslint-config-leroymerlin/node/javascript'],
  rules: {
    /*
      Add any additional rules here
    */
    'no-console': 'warn',
  },
};
```

## Using with Typescript apps

`@leroymerlin/eslint-config-leroymerlin/node/typescript`

### Install & Usage

```bash
npm install --save-dev eslint prettier @leroymerlin/eslint-config-leroymerlin @typescript-eslint/eslint-plugin
```

**.eslintrc.js** (An example)

```javascript
'use strict';

module.exports = {
  root: true,
  parserOptions: {
    project: 'tsconfig.json',
  },
  extends: ['@leroymerlin/eslint-config-leroymerlin/node/typescript'],
  rules: {
    /*
      Add any additional rules here
    */
    'no-console': 'warn',
  },
};
```

## Additional Configuration

**Please**, use it config with [husky](https://github.com/typicode/husky) 🐶 and [lint-staged](https://github.com/okonet/lint-staged) 🚫💩

To use git-hooks, install required dependencies via npm:

```bash
npx husky-init && npm install \
&& npm install --save-dev lint-staged
```

**.husky/pre-commit**

```bash
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install lint-staged
```

**lint-staged.config.js** (Javascript apps)

```javascript
'use strict';

module.exports = {
  '*.{js,json,md,y*ml}': ['prettier --write'],
  '*.js': ['eslint --cache --fix'],
};
```

**lint-staged.config.js** (Typescript apps)

```javascript
const fs = require('fs');

function generateTSConfig(stagedFilenames) {
  const tsconfig = JSON.parse(fs.readFileSync('tsconfig.json', 'utf8'));
  tsconfig.include = stagedFilenames;
  fs.writeFileSync('tsconfig.lint.json', JSON.stringify(tsconfig));
  return 'tsc --noEmit --project tsconfig.lint.json';
}

module.exports = {
  '*.{js,ts,json,md,y*ml}': ['prettier --write'],
  '*.ts': ['eslint --cache --fix', generateTSConfig],
};
```

## License

@leroymerlin/eslint-config-leroymerlin is [MIT](LICENSE).
npm package: @leroymerlin/nestjs-logger
Description: Logger for NestJS based on pino
Author: Leroy Merlin Vostok LLC
Latest version: 2.0.0

### @leroymerlin/nestjs-logger

[Nest.js](https://nestjs.com/) module wrapper for [pino](https://getpino.io/) logger.

## Installation

```bash
npm install --save @leroymerlin/nestjs-logger @leroymerlin/nestjs-async-hooks
```

## Quick Start

Import LoggerModule into the root AppModule and use the LoggerModule#forRoot() method to configure it.

```typescript
// app.module.ts

import { LoggerModule } from '@leroymerlin/nestjs-logger';
import { AppController } from './app.controller';
import { AppService } from './app.service';

@Module({
  imports: [LoggerModule.forRoot({ name: 'app-name' })],
  controllers: [AppController],
  providers: [AppService],
})
class AppModule {}
```

Use logger as the main Nest logger

```typescript
// main.ts

import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { PinoLoggerService } from '@leroymerlin/nestjs-logger';

async function bootstrap() {
  const app = await NestFactory.create(AppModule);

  app.useLogger(app.get(PinoLoggerService));

  await app.listen(3000);
}

bootstrap();
```

Use logger in app as default logger

```typescript
// app.service.ts

import { Injectable, Logger } from '@nestjs/common';

@Injectable()
export class AppService {
  private readonly logger = new Logger(AppService.name);

  constructor(private readonly appRepository: AppRepository) {}

  async read(id: string) {
    try {
      this.logger.debug('read', id);
      const message = await this.appRepository.readById(id);
      return message;
    } catch (error) {
      this.logger.error(error, 'read failed', id);
      return 'Error';
    }
  }
}
```

## License

@leroymerlin/nestjs-logger is [MIT](LICENSE).
npm package: @leroymerlin/nestjs-opentelemetry
Description: OpenTelemetry module for NestJS
Author: Leroy Merlin Vostok LLC
Latest version: 1.4.0

## @leroymerlin/nestjs-opentelemetry

[Nest.js](https://nestjs.com/) module wrapper for [OpenTelemetry](https://opentelemetry.io).

## Installation

```bash
npm install --save @leroymerlin/nestjs-opentelemetry
```

## Usage

Import OpenTelemetryModule into the root AppModule and use the OpenTelemetryModule#forRoot() method to configure it.

```typescript
// app.module.ts

import { ExporterConfig, PrometheusExporter } from '@opentelemetry/exporter-prometheus';
import { HttpInstrumentation } from '@opentelemetry/instrumentation-http';
import { OpenTelemetryModule, OpenTelemetryModuleOptions } from '@leroymerlin/nestjs-opentelemetry';
import { JaegerExporter } from '@opentelemetry/exporter-jaeger';
import { TraceIdRatioBasedSampler } from '@opentelemetry/core';
import { Module } from '@nestjs/common';

import { AppController } from './app.controller';
import { AppService } from './app.service';

const ignoreIncomingPaths = [/\/health/i, /\/api-docs/i];
const openTelemetryConfig = { endpoint: 'http://path.to.jaeger:14268/api/traces', samplerRatio: 1 };

const httpInstrumentation = new HttpInstrumentation({ ignoreIncomingPaths });
const sampler = new TraceIdRatioBasedSampler(openTelemetryConfig.samplerRatio);
const traceExporter = new JaegerExporter({ endpoint: openTelemetryConfig.endpoint });
const exporterConfig: ExporterConfig = { port: 9464, endpoint: 'metrics' };
const metricExporter = new PrometheusExporter(exporterConfig);

const openTelemetryModuleOptions: OpenTelemetryModuleOptions = {
  sampler,
  traceExporter,
  metricExporter,
  serviceName: 'application-name',
  instrumentations: [httpInstrumentation],
};

const openTelemetryDynamicModule = OpenTelemetryModule.forRoot(openTelemetryModuleOptions);

@Module({
  imports: [openTelemetryDynamicModule],
  controllers: [AppController],
  providers: [AppService],
})
export class AppModule {}
```

## License

@leroymerlin/nestjs-opentelemetry is [MIT](LICENSE).