Skip to content
This repository has been archived by the owner on Feb 5, 2022. It is now read-only.

Plans for the next major version (v2.0) #135

Open
egoist opened this issue Oct 30, 2019 · 10 comments
Open

Plans for the next major version (v2.0) #135

egoist opened this issue Oct 30, 2019 · 10 comments

Comments

@egoist
Copy link
Member

egoist commented Oct 30, 2019

@cannap
Copy link

cannap commented Nov 17, 2019

hi, thanks for sao whats about parsing args? directly witout using third party lib :D

@metasean
Copy link

@egoist - Do you have a rough timeline for version 2.0?

@madeleineostoja
Copy link

Just chiming in to say that I think the current saofile.js format is more intuitive than the proposed format.

Personally I love Hygen's approach to prompts and copying files. Have a basic mode for just parsing all the files in template with EJS, and then a more advanced mode for fine-tuning the actions.

But that said I think the current format is great 👍

@madeleineostoja
Copy link

And the scaffolded project upgrade tool would be amazing

@egoist
Copy link
Member Author

egoist commented May 9, 2020

@seaneking loading generators based on folder structure and using inline front matter instead of config file look pretty interesting 👀 maybe we should consider that too.

@madeleineostoja
Copy link

madeleineostoja commented May 9, 2020

I don't think the inline frontmatter would be a good approach for sao, since it really breaks down once you have more than a couple of files. It's great for mini generators for new components/etc like Hygen was designed for, but not for whole projects like sao is designed for. They're complimentary tools/approaches and I use both.

For example I use sao to scaffold out client Gatsby projects, and having to write frontmatter for the 93 files in that template would be really painful.

Using folder structure for generators and the rest is really lovely though. I just think sao should use folder structure within template to dicate output as it currently does. Maybe with override options in an optional sao.config.js or whatever file for more advanced control

@madeleineostoja
Copy link

Just rewriting the aforementioned Gatsby generator (coming from Yeoman) and one change I think sao should make for v2 is taking a function for the filter argument to add, passing the answers hash and expecting to return an array of files to exclude. Right now the key:value object is pretty limiting.

@egoist
Copy link
Member Author

egoist commented May 9, 2020

@seaneking: passing the answers hash and expecting to return an array of files to exclude.

You can use files to achieve this:

actions() {
  return [
  	{
  		type: 'add',
  		files: ['*', !this.answers.ts && '!tsconfig.json'].filter(Boolean)
	}
  ]
}

@madeleineostoja
Copy link

Oh nice. I didn't realise you could pass a function with the generator instance to actions. In that case I think that should be better documented, and maybe the filter and similar methods deprecated, because you can acheive all that more succinctly by returning a function like this.

FWIW sao errored when I tried to access this.answers in actions, I had to pass access it from the generator instance passed in, ie:

actions({ answers }) => [ ... ]

@egoist
Copy link
Member Author

egoist commented May 15, 2020

Started the work #145

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants