Coder Social home page Coder Social logo

renovate-config's Introduction

Renovate configs (and more)

This repository hosts several sharable configs that can be consumed and customized by Snowcoders packages.

We're open to hosting more, as long as they are a part of the Snowcoders ecosystem.

Other things that are useful from this repository

  • .gitignore - We wil notify about updates via our changelog
  • .npmignore - We wil notify about updates via our changelog

Usage

A great example of how to use these configs is this repository itself! Though for you instead of referencing the dist folder directly you would reference @snowcoders/renovate-config

Eslint config

  1. Install dependencies

    npm i --save-dev --exact eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-config-prettier eslint-plugin-prettier
  2. Create file.eslintrc.js.

  3. Add the following contents

    /* eslint-disable */
    const configs = require("@snowcoders/renovate-config");
    
    module.exports = configs.eslint;

Husky config

  1. Install dependencies

    npm i --save-dev --exact husky lint-staged
  2. Create file.huskyrc.js.

  3. Add the following contents

    /* eslint-disable */
    const configs = require("@snowcoders/renovate-config");
    
    module.exports = configs.husky;

Jest config

  1. Install dependencies

    npm i --save-dev --exact jest ts-jest
  2. Create file jest.config.js.

  3. Add the following contents

    /* eslint-disable */
    const configs = require("@snowcoders/renovate-config");
    
    module.exports = configs.jest;

Lint staged config

  1. Install dependencies

    npm i --save-dev --exact husky lint-staged
  2. Create file.lintstagedrc.js.

  3. Add the following contents

    /* eslint-disable */
    const configs = require("@snowcoders/renovate-config");
    
    module.exports = configs.lintStaged;

Prettier config

  1. Install dependencies

    npm i --save-dev --exact prettier
  2. Create file.prettierrc.js.

  3. Add the following contents

    /* eslint-disable */
    const configs = require("@snowcoders/renovate-config");
    
    module.exports = configs.prettier;

Sortier config

  1. Install dependencies

    npm i --save-dev --exact sortier
  2. Create file.sortierrc.js.

  3. Add the following contents

    /* eslint-disable */
    const configs = require("@snowcoders/renovate-config");
    
    module.exports = configs.sortier;

Typescript config

  1. Install dependencies

    npm i -D -E typescript

For all configs, you'll need to specify:

  • compilerOptions.rootdir
  • compilerOptions.outdir
  • include
  • exclude

For libraries

Our project has three tsconfigs for libraries

  • tsconfig.library.json - config to be used for cli tools within the project
    • E.g. this is what your root tsconfig.json extends
  • tsconfig.library.cjs.json - config to be used for cjs output
  • tsconfig.library.esm.json - config to be used for esm output

For websites

Our project has four tsconfigs for websites

  • tsconfig.website.json - config to be used for cli tools within the project
    • E.g. this is what your root tsconfig.json extends
  • tsconfig.website.browser.dev.json - config for webpack to use for development browser asset builds
  • tsconfig.website.browser.prod.json - config for webpack to use for production browser asset builds
  • tsconfig.website.server.json - config to build the node server assets

renovate-config's People

Contributors

renovate-bot avatar renovate[bot] avatar k2snowman69 avatar

Watchers

James Cloos avatar  avatar  avatar

renovate-config's Issues

Update lint-staged config

Lint staged no longer supports complex configs. To ignore package-lock you'll need something like

  '**/!(package-lock).{json}': [
    'exec-if-exists prettier --write',
    'exec-if-exists sortier',
    'git add',
  ],

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-node v4
.github/workflows/publish.yml
  • actions/checkout v4
  • actions/setup-node v4
npm
package.json
  • exec-if-exists ^4.0.0-beta.2
  • @release-it/keep-a-changelog 5.0.0
  • @types/eslint 8.56.10
  • @typescript-eslint/eslint-plugin 7.13.0
  • @typescript-eslint/parser 7.13.0
  • changelog-updater 2.0.3
  • concurrently 8.2.2
  • cpy-cli 5.0.0
  • eslint 8.57.0
  • eslint-config-prettier 9.1.0
  • eslint-plugin-import 2.29.1
  • eslint-plugin-prettier 5.1.3
  • husky 9.0.11
  • jest 29.7.0
  • lint-staged 15.2.7
  • prettier 3.3.2
  • release-it 17.3.0
  • rimraf 5.0.7
  • sortier 2.0.2
  • ts-jest 29.1.4
  • tslib 2.6.3
  • typescript 5.4.5
  • node >=16.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

Host all cosmiconfigs in a central location

Problem

One of the recent more annoying situations we've run into so far is fixing up .lintstagedrc files across all our code bases everytime we add a new file sort type to sortier for example.

To understand the scale of the issue, I'll give you an example that will be coming up in the near future:

  1. Sortier adds the ability to sort .css, .scss, .less files
  2. For all Snowcoders repositories (currently 15 separate repos)
    1. Upgrade sortier
    2. Update .sortierrc to add the custom css options
    3. Update .lintstagedrc to run sortier across .css, .scss, .less files
    4. Create a pull request and merge it

Overall this is already unsustainable and annoying to deal with.

Finally, whenever a major breaking change happens to the configs, it would be great if the config would break as well. Right now however, since they are all in *rc files, we get no indication from renovate if the major update is breaking or not.

Proposed solution

Use this repository as a shared config repository that all other repositories can pull a shared config down from. The new upgrade scenario would be:

  1. Sortier adds the ability to sort .css, .scss, .less files
  2. Update this package's cosmiconfig and update peer-dependency on @snowcoders/sortier
  3. Publish new version
  4. Renovate opens PRs on all repositories

How to do it

We will make use of cosmiconfig's ability to consume *.js config files. Also, we will utilize typescript so we are aware of any non-backwards compatible config changes (if the configs are typed properly).

This repository will export something like this (though compiled down to ES5):

import { ReprinterOptions } from '@snowcoders/sortier';
export const sortier: ReprinterOptions = {
  isTestRun: false,
  logLevel: "diagnostic",
  js: {
    sortClassContents: {
      order: "usage"
    }
  }
};

Then the package actually running sortier will have a config that looks like this:

let configs = require("@snowcoders/renovate-config");

module.exports = configs.lintStaged;

Currently cosmiconfig doesn't support ES6 so it has to be written in an ES5 syntax

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)

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.