Git Product home page Git Product logo

codeowners-flow's Introduction

Hello/Hola/Olá! I'm Raul 👋

Born in the lands of Brazil, making a home in Spain.

Here are a few things you should know about me:

  • memes and Non-sense humor 🤡 give me life!
  • I'm a fervent admirer of all forms of art 🎨
  • I enjoy capturing moments 📸;
  • Traveling and exploring new cultures 🧳 fuels my curiosity and broadens my perspective.
  • When it comes to games 🎮, I'm an all-rounder. No allegiance to a single platform here!
  • I find joy in the rhythm of dance 🕺
  • My dedication extends to fitness 🏋️‍♂️ as well. A healthy body fosters a healthy mind.
  • I have a knack for nifty gadgets 🔮, regardless of their (lack of) practicality.

Oh, and did I mention my affinity for problem-solving? It's not just limited to humans, but extends to machines as well. Teaching both people 👨🏽‍🏫 (in human language) and machines 👨🏽‍💻 (in programming language) is a passion of mine.

Connect With Me

I'm not a social media addict person, but you can find me on:

  • My Website - Consider this my experimental lab and personal blog, where I play around with ideas and share my thoughts and musings.
  • Twitter - A mixed bag of my tech interests, political views, and a dash of humor;
  • Instagram - My visual diary of carefully curated shots;
  • Curriculum - If you're curious about my skills and professional experience.

Let's connect and create together! 😁

codeowners-flow's People

Contributors

github-actions[bot] avatar raulfdm avatar

Stargazers

 avatar

Watchers

 avatar  avatar

codeowners-flow's Issues

add option to tweak programmatically the configuration

Description

The user should be allowed to extend the configuration programmatically. This will be handy for automation/scripting.

import { updateConfig, defineRule } from "@codeowners-flow/cli/config";

await updateConfig((currentConfig) => {
  currentConfig.rules = defineRule({
    patterns: ["module/logger"],
    owners: ["@company/infra"],
  });

  return currentConfig;
});

Because the user gets the current config, it might be useful to provide a field like _meta so they can add and maintain info in the config level but also have access, like:

// codeowners.config.mjs

const mainTeam = { name: '@company/core-team' };

/** @type {import('@codeowners-flow/cli/config').UserConfig} */
export default {
  outDir: '.github',
  _meta: {
    mainTeam, // HERE
  },
  rules: [
    {
      patterns: ['*'],
      owners: [mainTeam],
    },
  ],
};

Then:

import { updateConfig, defineRule } from "@codeowners-flow/cli/config";

await updateConfig((currentConfig) => {
  currentConfig.rules = defineRule({
    patterns: ["module/logger"],
    owners: ["@company/infra", currentConfig._meta.mainTeam], // CONSUMING HERE
  });

  return currentConfig;
});

I'm not sure how to make this type-safe, so it'll be the user's responsibility to ensure the value is there.

Define config API

API config

Every project would include a codeowner.config.mjs. This file must default return an array of objects.

Each object should contain:

type OwnerRule = {
  pattern: string,
  excludeMatch?: string[],
  owners: string[],
  comments?: string[]
}

type CodeOwnerManager = {
  outDir: string;
  rules: OwnerRule[]
}

Example:

export default {
  outDir: ".github",
  rules: [
    {
      pattern: "*",
      owners: ["@company/core-team"],
      comments: [
        "Everything else will be fallback to @company/core-team to approve",
      ],
    },
  ],
};

This will lead to a .github/CODEOWNERS with the following content:

# Everything else will be fallback to @company/core-team to approve
* @company/core-team

Error calling the CLI

Description

After installing the CLI and trying to run, I got:

$ pnpm codeowners-flow     
node:internal/errors:464
    ErrorCaptureStackTrace(err);
    ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/path/to/node_modules/.pnpm/@[email protected]/node_modules/@codeowners-flow/cli/dist/index.js' imported from /path/to/node_modules/.pnpm/@[email protected]/node_modules/@codeowners-flow/cli/bin/index.js
    at new NodeError (node:internal/errors:371:5)
    at finalizeResolution (node:internal/modules/esm/resolve:418:11)
    at moduleResolve (node:internal/modules/esm/resolve:981:10)
    at defaultResolve (node:internal/modules/esm/resolve:1078:11)
    at ESMLoader.resolve (node:internal/modules/esm/loader:530:30)
    at ESMLoader.getModuleJob (node:internal/modules/esm/loader:251:18)
    at ESMLoader.import (node:internal/modules/esm/loader:332:22)
    at importModuleDynamically (node:internal/modules/esm/translators:106:35)
    at importModuleDynamicallyCallback (node:internal/process/esm_loader:35:14)
    at file:///path/to/node_modules/.pnpm/@[email protected]/node_modules/@codeowners-flow/cli/bin/index.js:4:1 {
  code: 'ERR_MODULE_NOT_FOUND'
}

Checking the node_modules, it seems the dist folder isn't there 🫠

CleanShot 2023-08-16 at 09 36 11

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.