paritytech / opstooling-js

Shared functionality for OpsTooling projects
https://www.npmjs.com/package/@eng-automation/js
Apache License 2.0
0 stars 1 forks source link

Making opstooling-scripts work in other repositories #23

Closed mutantcornholio closed 1 year ago

mutantcornholio commented 1 year ago

Problems found:

  1. Running node as entrypoint instead of ts-node will most probably result in some ESM-related problems down the road.
  2. For some reason, I used cwd for optstooling-scripts as opstooling-js's directory. That doesn't go well in other repos.
  3. Added modification of NODE_PATH to ensure that scripts in opstooling-js get their own deps.
  4. Specified tsconfig.json in parameters, so it would be always right one
  5. generate-types didn't want to work with joi of different versions in opstooling-js and the target repo. Aligned the versions. This'll probably happen again, but good thing is, we'll notice it only when we'll change schemas (as we commit the results)
  6. Added prettier to deps: prettier is used in generate-types, and it must be in deps for it to work in other repositories
mutantcornholio commented 1 year ago

PR is based on https://github.com/paritytech/opstooling-js/pull/22, so temporary moved to draft