Hey there,
I think it would be nice to be able to provide a custom Git repository URL for a starter instead of the default ones (blank, tabs, sidemenu, super).
Example usage:
# ideal usage
ionic start MyApp https://github.com/ihadeed/ionic2-starter-custom --v2
# another way if you need .zip files instead of git repos
ionic start MyApp https://example.com/path/to/starter.zip --v2
@ihadeed Are you aware of any lists of community starters?
No, but this feature can open up possibilities such as:
Shipping starters/templates manually would require more maintenance even if there are no breaking changes. (Must modify package.json to match ionic-team/ionic2-app-base)
Wouldn't this also enable to create sample projects that are automatically up to date? Instead of cloning a repo with a set package.json, it would just get the one from the app-base. Of course this would also introduce the danger of non-working projects because some code changed, but this almost never happens for Ionic - and could inform the authors about breakage much sooner than right now.
Also, i ask about this feature because i develop an "starter generator" wich include well proved code for common task like Maps or geolocation, auto generate Code , etc.
I love that heard you work ok It ;-)
For those following this issue, I am soon launching the new Ionic Starters repo, which will contain all official and community starters. Please see the CONTRIBUTING.md for details. An example of a community starter is located here: https://github.com/ionic-team/starters/tree/master/ionic-angular/community. @danielsogl is also working on a PR to add a starter here: https://github.com/ionic-team/starters/pull/1.
The idea of the new starters repo is that starters are now _generated_, and the CLI will happily and ignorantly download a tar.gz instead of doing ugly overlaying and separate package installations in the CLI. This also allows us to put the starters in a CDN and distribute them over the world to improve download speeds.
If you install the alpha Ionic CLI (npm i -g ionic@canary), you can test the new starter process I've been working on. The example starter I added can be tested with:
ionic start myApp ionic-team/example
Curious to hear everyone's thoughts!
@dwieeb so does that mean if I have a template on my gitlab I can do ionic start myApp gitlab.com:mebibou/starter ?
@mebibou The community starters are just git submodules, so it actually doesn't matter where they're hosted. What matters is the scope/name "ID", which comes from the path of the submodule in the directories.
So the example submodule in there at ionic-angular/community/ionic-team/example has an "ID" of ionic-team/example. @danielsogl's PR has it at ionic-angular/community/danielsogl/ionic-super-starter, so it would be:
ionic start myApp danielsogl/ionic-super-starter
Unless it is changed before the PR is accepted.
I'm thinking each community starter's repo can show the proper start command for that starter, and it shouldn't be a problem. 馃檪
Sorry if i misunderstood but, this PR only accepts starters from community, isn't ?
if i can provide a private template hosted in ssh://bitbucket.org/macklus/mi-private-repo, i think it should be like:
and thats all.
is that possible ?
thanks !
@macklus which PR are you talking about?
But yeah, I think @dwieeb added something about community starters, which does not actually provide a solution for this feature request which is to use any repo as a custom starter, which is why he re-opened it?
@mebibou , i talk about @dwieeb comment https://github.com/ionic-team/ionic-cli/issues/2156#issuecomment-341874956 .
I not sure about the problem on this. So far i understood, question here is change current ionic-cli behaviour to accept repo url. This, allow to use community starters (maybe their url is long, but is only copy and paste), and private starters.
@mebibou @macklus Correct, the latest changes allow for public community starters to be added, not any repo URL.
There are two use cases here (which @ihadeed eluded to here):
1) Start my app using an official or public community starter
2) Start my app by cloning a private template that I bought
The starters repo satisfies use case 1, which was the tough part. We needed to move away from the stopgap that the CLI was doing to merge files (it was gross, trust me). With this repo, starters will be easier to maintain, we'll be able to ensure some level of quality, starters can "lock in" the versions of their app base (allows for Ionic 2, 3, 4 starters to still work), the downloads will be faster because they'll be distributed around the world w/ CloudFront, etc.
Use case 2 can be satisfied by turning this:
git clone repo_url
npm install
ionic serve
Into this:
ionic start repo_url
ionic serve
If the repo URL is sure to be git, I can easily do this for 3.17.0 release.
@dwieeb thanks about your update !
will you work on use case 2 ? is there any way i can help on this ?
@macklus Yes, I just wanted to get 3.17.0 out. I will work on it for 3.18.0!
@ihadeed @macklus @mebibou This should now be supported. Please test by installing the alpha CLI: npm i -g ionic@canary.
It should work on a variety of git repository URLs (HTTP and SSH), e.g. https://github.com/ionic-team/ionic-conference-app and [email protected]:ionic-team/ionic-conference-app.git
Most helpful comment
For those following this issue, I am soon launching the new Ionic Starters repo, which will contain all official and community starters. Please see the
CONTRIBUTING.mdfor details. An example of a community starter is located here: https://github.com/ionic-team/starters/tree/master/ionic-angular/community. @danielsogl is also working on a PR to add a starter here: https://github.com/ionic-team/starters/pull/1.The idea of the new starters repo is that starters are now _generated_, and the CLI will happily and ignorantly download a
tar.gzinstead of doing ugly overlaying and separate package installations in the CLI. This also allows us to put the starters in a CDN and distribute them over the world to improve download speeds.If you install the alpha Ionic CLI (
npm i -g ionic@canary), you can test the new starter process I've been working on. The example starter I added can be tested with:Curious to hear everyone's thoughts!