Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable npm init @cadl-lang using @cadl-lang/create package #1041

Open
nguerrera opened this issue Sep 14, 2022 · 7 comments
Open

Enable npm init @cadl-lang using @cadl-lang/create package #1041

nguerrera opened this issue Sep 14, 2022 · 7 comments
Milestone

Comments

@nguerrera
Copy link
Contributor

nguerrera commented Sep 14, 2022

Two issues are discussed below but this one tracks only getting npm init @cadl-lang to work as a nicer/easier to remember command-line than npx -p @cadl-lang/compiler cadl init

The other issue, making local cadl resolve without a global cadl is tracked by #1116


It would be nice if you could play with cadl without installing it globally via npm install -g.

I tried these steps:

md repro
cd repro
npm uninstall -g @cadl-lang/compiler # to make sure it didn't interfere
npm init -y
npm install @cadl-lang/compiler
npx cadl code install
code .

This errors starting the language server, it can't find the cadl-server executable. We should be able to make it find it off workspace root without relying on the global executable to run its resolver for this case. That should be a relatievely straight-forward fix. (EDIT: tracked by #1116)

The other problem I see in this scenario is that I can't use npx cadl init to get started because I need to npm install @cadl-lang/compiler first while cadl init templates help me to do that. Chicken and egg. (Edit: we can make npm init @cadl-lang work with a @cadl-lang/create package, this issue now tracks that.)

We should probably fix the reliance on global cadl to find local cadl (EDIT: tracked by #1116) and then at least document an alternate flow that doesn't require npm install -g.

@ghost ghost added the Needs Triage label Sep 14, 2022
@bterlson
Copy link
Member

bterlson commented Sep 14, 2022

npx cadl init could probably move to something like npm init @cadl-lang as documented here, at least as an option.

@timotheeguerin
Copy link
Member

does npx -p @cadl-lang/compiler cadl init not work?
This is definitely not optimal and having the @cadl-lang/create package would be nice to simplify but I think we can already do that.

@markcowl
Copy link
Contributor

  • @nguerrera please split off the init/create issue separately

@markcowl markcowl added this to the [2022] November milestone Sep 20, 2022
@markcowl
Copy link
Contributor

pri: 0
est: 5

@nguerrera
Copy link
Contributor Author

I was supposed to split this up, but didn't yet, but looks like @timotheeguerin filed #1116 already.

@nguerrera
Copy link
Contributor Author

So this one can be about the init part and that one can be about needing global cadl to resolve local one unnecessarily.

@nguerrera nguerrera changed the title Make it possible to work through basic getting started without npm install -g Enable npm init @cadl-lang using @cadl-lang/create package Oct 3, 2022
@nguerrera nguerrera removed this from the [2022] November milestone Oct 3, 2022
@timotheeguerin timotheeguerin added this to the Backlog milestone Oct 4, 2022
@timotheeguerin
Copy link
Member

est: 3

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

No branches or pull requests

4 participants