Git Product home page Git Product logo

nx-pwm's Issues

Create an init generator

The init generator should

  • setup the .nx-pwm.json file
  • allow to add a depcheck target for projects

Template for the config file:

{
  "$schema": "./node_modules/nx-pwm/src/lib/config-schema.json",
  "versionType": "independent",
  "depcheck": {
    "ignore": {
      "discrepancies": {
        "*": []
      },
      "missing": {
        "*": []
      }
    }
  }
}

TESTS!

I need to test all of this, it's time.

Initial Research

Tooling in each repo

nx-packages and nx-plugins are repos internal to my company. Both are packages workspaces, the plugins repo is synced-versions, and the packages repo is independent.


nx-packages
File Name Purpose Notes
tools/check-lock-files.js Ensures that there’s no lock file but yarn.lock, and ensures that yarn.lock does not reference the local registry  
tools/check-versions.ts Checks library package json files, and dependencies that have newer versions Contains a check to ignore libraries that are part of the repo
tools/depcheck/discrepancies.ts Looks for dependencies in project package.json files that do not satisfy the root package.json (or vice versa)  
tools/depcheck/missing.ts Uses the depcheck module to find missing imports in projects  
tools/depcheck/index.ts CLI entry point for running the discrepancies/missing checks are reporting those Contains a check to ignore libraries that are part of the repo
tools/library-publishing-plugin.js NX Plugin that adds version/publish targets to packages Only relevant for independent-versions libraries
tools/local-registry.sh Manages setting-up/tearing down and configuring package managers to work with verdaccio  
tools/local-registry/config.yml Verdaccio config our configs might be invalid since it still only references @nrwl packages as a special case, something that we might be missing out
tools/package.ts Builds packages and updates the built package.json for local or prod publishing  
tools/scripts/publish.mjs Script generated by NX itself to be a good default script for publishing repositories  
tools/tsconfig.scripts.json tsconfig for .ts scripts  
tools/tsconfig.tools.json tsconfig generated by NX, difference is "rootDir": "*"  
tools/workspace-utils.ts Utility module that exports metadata about projects in the repository for other scripts  

nx-plugins
File Name Purpose Notes
tools/check-lock-files.js Same as in nx-packages  
tools/check-versions.ts Intended for use in plugins which have a lib/utils/versions.ts package. Checks for newer versions of packages specified there. Requires external configuration to differentiate between scoped packages and other packages.
tools/depcheck/discrepancies.ts
tools/depcheck/index.ts
tools/depcheck/missing.ts
Should be the same as in nx-packages. TODO: diff the code
tools/find-affected.js Basically a hack until affected --tags is added Should be a reusable github action
tools/local-registry.sh
tools/local-registry/config.yml
Same as in nx-packages  
tools/nx-release.js Script to release all packages in a synced-version workspace  
tools/package.js Should be more or less the same as in nx-packages, there is definitely a difference tho. CHECKITOUT
tools/publish.sh Utility script of nx-release.js to publish all the packages  
tools/tsconfig.scripts.json
tools/tsconfig.tools.json
Same as in nx-packages

  • Add same summary for the NX repo itself
nrwl/nx
File Name Purpose Notes

What’s the scope of the CLI

Provides tooling for developing, validating, and optionally building & publishing packages in an NX workspace.

  • Differentiation should be done for synced-version and independent-version.

TODO: Check how the semver plugin works for synced-version. Perhaps nx-release.js is deprecated.

  • Take on the local-registry utility, improve it, add a status utility, etc.

  • check-version.ts should be consolidated to a single tool and have it check plugins and normal libraries simultaneously.

  • Perhaps check-lock-files should be adjusted to allow different package managers?

Create the CLI/Plugin project

Requirements

CLI

nx-pwm should be a CLI so that it can be used the following way:

$ yarn add -D nx-pwm
$ yarn pwm check-versions
$ yarn pwm depcheck

Plugin

nx-pwm should also be a plugin so that it can be used the following way:

$ yarn add -D nx-pwm
$ yarn nx g nx-pwm:install

Implementation

Project generation

As far as I'm concerned, nx-pwm can be generated with @nrwl/nx-plugin.
This does limit the ability to extract logic to nx-based libraries.
For now, this is acceptable. If I want to extract certain behaviors to libraries, I might as well make nx-pwm modular and publish the behaviors.

CLI Impl

TBD

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.