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

Cleanup and update repositories #174

Closed
targos opened this issue Feb 28, 2022 · 7 comments
Closed

Cleanup and update repositories #174

targos opened this issue Feb 28, 2022 · 7 comments
Assignees

Comments

@targos
Copy link
Member

targos commented Feb 28, 2022

There have been a lot of changes in how we structure and test our projects since the creation of this org. Here are some things that need to be cleaned up or changed, and a list of repositories where to do it.

To do

1. Rename some config files

If they exist:

  • .babelrc -> .babelrc.json
  • .prettierrc -> .prettierrc.json

2. Move Prettier config from package.json to .prettierrc.json.

There are some projects where the Prettier config is not in a separate file (example).
Copy the config to a file named .prettierrc.json and remove the field from the package.json.

3. Rename prepublishOnly script to prepack

If it exists in package.json.

4. Add prettier and prettier-write scripts

In package.json:

{
  "scripts": {
    "prettier": "prettier --check src",
    "prettier-write": "prettier --write src"
  }
}

The "test" script should be updated to call npm run prettier at the end.

Example

5. Update dependencies

ncu -u

Be careful if there are breaking changes in non-dev dependencies.
Check the changelog of the dependency and adapt the project if necessary.

6. Remove eslint-plugin-* from dependencies

After updating dependencies, we can do this because the eslint-config-cheminfo packages have the plugins as peer dependencies.
Make sure to use the latest version of Node.js, otherwise it won't work.

7. Refactor how tests are run

There are multiple things to do here. See floyd-warshall for an example of a correct setup.

  • If there is a test-coverage npm script, remove it.
  • If there is a testonly npm script, rename it to test-only.
  • Add --coverage to the test-only npm script. For example: "test-only": "jest --coverage"
  • If there is a "jest" field with only "testEnvironment": "node" in it, remove the field. The latest version of Jest defaults to this environment.
  • Otherwise, if there are more things in the Jest config. Move it to a jest.config.js file.

8. Rename History.md to CHANGELOG.md

  • Rename the file
  • Add # Changelog + a new line at the beginning.

Example

9. Remove Travis config

  • Delete `.travis.yml
  • Delete Travis-related lines from README.md

10. Remove david config

Delete david-related lines from README.md

Example

11. Remove docs folder

If it exists.

12. Setup or update GitHub workflows

  • If the workflow doesn't exist, create it.
  • If the workflow already exists, replace it with the new template.

.github/workflows/nodejs.yml

name: Node.js CI

on:
  push:
    branches:
      - main
  pull_request:

jobs:
  nodejs:
    # Documentation: https://github.com/zakodium/workflows#nodejs-ci
    uses: zakodium/workflows/.github/workflows/nodejs.yml@nodejs-v1

.github/workflows/release.yml

name: Release

on:
  push:
    branches:
      - main

jobs:
  release:
    # Documentation: https://github.com/zakodium/workflows#release
    uses: zakodium/workflows/.github/workflows/release.yml@release-v1
    with:
      npm: true
    secrets:
      github-token: ${{ secrets.BOT_TOKEN }}
      npm-token: ${{ secrets.NPM_BOT_TOKEN }}

.github/workflows/documentationjs.yml

Only do this if there is no typedoc.yml workflow.

name: Deploy documentation.js on GitHub pages

on:
  workflow_dispatch:
  release:
    types: [published]

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Build documentation
        uses: zakodium/documentationjs-action@v1
      - name: Deploy to GitHub pages
        uses: JamesIves/github-pages-deploy-action@releases/v4
        with:
          token: ${{ secrets.BOT_TOKEN }}
          branch: gh-pages
          folder: docs
          clean: true
targos pushed a commit to mljs/levenberg-marquardt that referenced this issue Mar 1, 2022
targos pushed a commit to mljs/matrix that referenced this issue Mar 1, 2022
@wadjih-bencheikh18
Copy link
Member

wadjih-bencheikh18 commented Mar 1, 2022

@targos can i delete useless prettierignore file?

@targos
Copy link
Member Author

targos commented Mar 1, 2022

You have an example of such file?

@wadjih-bencheikh18
Copy link
Member

yes mljs/libsvm#20

@targos
Copy link
Member Author

targos commented Mar 1, 2022

yeah, you can remove that one.

@wadjih-bencheikh18
Copy link
Member

wadjih-bencheikh18 commented Mar 1, 2022

also here mljs/hclust#16 , mljs/decision-tree-cart#22
we need prettier check/write in src and all prettierignore folders are not included

targos pushed a commit to mljs/regression-base that referenced this issue Mar 2, 2022
targos pushed a commit to mljs/random-forest that referenced this issue Mar 2, 2022
targos pushed a commit to mljs/pls that referenced this issue Mar 2, 2022
targos pushed a commit to mljs/conrec that referenced this issue Mar 2, 2022
@wadjih-bencheikh18
Copy link
Member

@targos cleanup done

opatiny added a commit to mljs/regression-multivariate-linear that referenced this issue Jun 21, 2022
opatiny added a commit to mljs/regression-multivariate-linear that referenced this issue Jun 21, 2022
targos pushed a commit to mljs/regression-multivariate-linear that referenced this issue Jun 21, 2022
@targos targos closed this as completed Jul 24, 2023
jeus0522 pushed a commit to jeus0522/random-forest that referenced this issue Aug 9, 2024
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

No branches or pull requests

2 participants