-
Notifications
You must be signed in to change notification settings - Fork 343
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
feat: added a new web-ext create command #1170
Conversation
@rpl the rest of work here is to write a unit test case, right? I've written it in https://github.com/hiikezoe/web-ext/commits/cmd-create-libnpx branch. Does it work for you? (There is a small fix to make the test pass in the branch) Anyway, this command is pretty useful for me since writing manifest.json is the most troublesome thing when creating a new web extension. Thanks for the nice command! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mentioned this already on IRC but I think it would be nice if web-ext --verbose create ...
were to somehow log the version of the create-webextension
package in use. We will need to know this when getting bug reports from users.
Other than this, I like the idea of using libnpx
, especially to let users define third party create
templates.
const log = createLogger(__filename); | ||
|
||
type CreateParams = { | ||
projectPath: string, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be a required option? If so, it would be easier to pass in as an argument, like:
web-ext create my-project-path
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, right now I defined it as an additional yargs option to keep the initial version smaller and easier to evaluate, nevertheless I totally agree that make it just an additional required parameter would be way nicer for the user (and it is basically also as create-webextension works when used on its own).
Just curious, will this approach allow interactive prompts like For example, some of the options I imagine would include:
Given the number of permutations of options, I wonder if dynamically generating the appropriate skeleton is more scalable (and user-friendly) than fixed templates like |
Oh, and one very minor nit which you may well have addressed already: it might be a bit odd if, after running |
bump - it's been more than half a year, can this still be rebased and landed? This is the kind of convenience that makes the difference between "annoying tool to use for anyone but devs who already know everything" and "the tool you recommend to your friends to use" =) |
@rpl At the risk of feature creep - let's also make this part of the 3.0.0 release? |
Closing as incomplete / do not merge, this PR also got branched out a long time ago, I would create a new branch if we will resume work on it. |
It would be encouraging to see a new issue filed, then, because given all the JS framework tooling that come with |
We discussed this issue in a recent triage meeting and having a |
Can you name some of those tools (ideally with some links) so that future folks finding this issue through a web search know where to look further? Because I don't know any =/ |
This PR contains a prototype for a proposed approach to integrate
create-webextension
npm package into a new "web-ext create" command (which aims to fix #540) .Internally, the "web-ext create" command prototyped in this PR uses
libnpx
(which is the "lib" version of the "npx" tool) to run the executable from the local dependency (usingweb-ext create --project-path="project1"
), or optionally download and run the latest released version of thecreate-webextension
npm package on the fly (usingweb-ext create --use-latest ...
).We could also support an additional
--use-npm-version=...
parameter (to be able to download and use a particular released version of thecreate-webextension
npm package), as well as optionally supporting alternative npm packages as project generators.(and we could also evaluate to use a similar approach for the "web-ext lint" command, so that we can allow the user to use a more updated version of the addons-linter even before a new "web-ext" version has been released).