2

I'm trying to convert my project over to a structure similar to the @polkadotjs repositories, but I'm finding the dev template provided a bit difficult to parse. Specifically:

  1. How do I use this repository as a base for my monorepo? Do I fork the repo and work off of it or is there a cli setup?

  2. How do I use the dev template package in the repo to create a new app/package in packages? - the package.json is hard to parse. I would like to be able to build, test, lint my app/package without worrying too much about config. But I can't find any scripts that do that, only a list of bins, which is quite different from the @polkadotjs/apps repo.

Note: I am aiming for a similar setup as the @polkadotjs monorepos with one for packages (including typegen) and another for apps. Thanks!

1 Answer 1

7

The polkadot-js dev repo is not a template project for helping with using the @polkadot/* libs, rather it is a set of templates, configs and scripts that helps all the polkadot-js repos to be consistent in terms of structure and coding.

What this means internally to the polkadot-js org -

  • There is a single shared config for everything - this means that each other repo (be it api, extension, apps, common, phishing, ...) just re-uses the config, be it for Babel, eslint, Typescript, etc.
  • There are a set of scripts that perform build steps - this means that each polkadot-js repo just calls into @polkadot/dev for build, linting, publishing, etc.
  • There are a set of shared dev dependencies for all repos - this means that instead of managing versions for all of the above all-over, it is handled in a specific location and updates can be done seamlessly (obviously code-specific deps go into their normal places inside the repos)
  • Internally to this repo the src/ is never used anywhere - it is there to test the scripts/configs as changes are made. So when it builds itself correctly, it generally means it builds other polkadot-js repos correctly as well

Overall it is not meant as a scaffold for anything external to polkadot-js, it purely is driven by the need for internal, very opinionated & very rigdit, tooling for the polkadot-js repos itself. It was never meant as a cli-like tool ala react-create-scripts or something else.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.