Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup dynamic module with all needs #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

SoufianeBenbah
Copy link
Collaborator

@SoufianeBenbah SoufianeBenbah commented Dec 16, 2024

Create referral module with ESLint and Prettier configurations

image ClickUp Task

#TASK_ID

💬 Description

This PR creates a dynamic NestJS module for referral code generation, addressing the need for unique referral codes based on a project key. This feature is essential for enabling distinct code generation across multiple projects, while also ensuring compliance with banned word restrictions.

🚨 Changelog

  • .eslintrc.js: Added ESLint configuration using Avicenne's ESLint settings.
  • .gitignore: Created a gitignore file to exclude compiled output and node_modules.
  • .husky/pre-commit: Implemented pre-commit hooks to enforce linting and testing before committing.
  • .husky/pre-push: Set up pre-push hook to ensure builds succeed before pushing to remote.
  • .prettierrc: Integrated Prettier configuration based on Avicenne's Prettier settings.
  • README.md: Updated the readme to provide documentation about the new referral module's features.
  • nest-cli.json: Configured the Nest CLI for improved project setup.

🔬 Test Zone

  • 🎨 Design check - Element Design reference - (Pixel perfect, Dimensions, Colors, Typography, Images, Responsiveness)
  • Manual test for the referral code generation process.
  • Review the setup and functionality of ESLint and Prettier configurations.
  • Confirm pre-commit and pre-push hooks function as intended.
  • Test various scenarios for encoding and validating referral codes, ensuring banned words are respected.

📝 Additional Notes

  • This module depends on the Avicenne ESLint and Prettier configurations.
  • Future tests and assertions regarding the referral code business logic will be required to ensure comprehensive unit test coverage.
  • Ensure compatibility with existing projects that might utilize the referral module functionality.

@SoufianeBenbah SoufianeBenbah self-assigned this Dec 16, 2024
Copy link
Member

@farischt farischt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has to be tested on an external project

Comment on lines +1 to +15
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: __dirname,
sourceType: 'module',
},
extends: ['@avicenne-studio'],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js'],
};
Copy link
Member

@farischt farischt Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module.exports = {
  extends: ["@avicenne-studio"],
};

Comment on lines +1 to +10
import { NestFactory } from "@nestjs/core";

import { ReferralModule } from "./referral.module";

async function bootstrap() {
const app = await NestFactory.create(ReferralModule);
await app.listen(3000);
}

void bootstrap();
Copy link
Member

@farischt farischt Dec 16, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed to start a server for this

@farischt
Copy link
Member

farischt commented Dec 16, 2024

IMO we should do the following things:

  • A simple node npm package in plain typescript that handles the code generation
  • Optionnaly create a nest js module that uses that library to generate codes

@wepee @au2001 any thoughts on that

@farischt farischt closed this Dec 16, 2024
@farischt farischt reopened this Dec 16, 2024
@au2001
Copy link
Member

au2001 commented Dec 16, 2024

IMO we should do the following things:

  • A simple node npm package in plain typescript that handles the code generation
  • Optionnaly create a nest js module that uses that library to generate codes

Totally agree yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants