Cli-microsoft365: Put related commands in separate folders to simplify maintenance

Created on 18 Nov 2017  路  4Comments  路  Source: pnp/cli-microsoft365

@erwinvanhunen brought up an interesting point: currently all SPO commands are in a single folder (o365/spo). Comparably, PnP PowerShell has 250 cmdlets. If we ever get to that point, this means that we'd end up with 500 files in a single folder (cmd + unit tests). Storing related commands in a separate folder could make it easier to maintain the commands. Restructuring the files now, would save us from refactoring down the road (changing paths to other classes, etc.).

There are a number of options we can choose from:

  1. create folder each noun, eg. o365/spo/tenant/cdn/origin, o365/spo/tenant/cdn/policy. We would end up with big folder tree and a few files in each folder but knowing the command you would know exactly where to find it.
  2. create folder for the first level eg. o365/spo/tenant, o365/spo/site, o365/spo/web. Each folder would contain all commands related to the given first level. When looking for a command, you have to know its first noun
  3. create folder the last level, eg. o365/spo/cdn, o365/spo/storageentity, o365/spo/app. You could locate the needed command file by its name. One problem is that we might get collisions like apps installed in the tenant vs. site collection app catalogs, which would be different commands but with the same name

Any other ideas or opinions @andrewconnell, @estruyf?

question work in progress

All 4 comments

I think that option 2 IMO is the best one. You will create fewer folders, split things by its scope, which still makes it easy to find everything.

Option 2, fo sho!

If we proceed with #34, then we'd end up with option 3. What do you guys think?

Let me take this

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vineet2907 picture vineet2907  路  3Comments

waldekmastykarz picture waldekmastykarz  路  3Comments

waldekmastykarz picture waldekmastykarz  路  3Comments

garrytrinder picture garrytrinder  路  3Comments

waldekmastykarz picture waldekmastykarz  路  3Comments