-
Notifications
You must be signed in to change notification settings - Fork 77
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
No default preset supported #67
Conversation
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.
Use the nextjs-preset
by default instead of one that's not going to be open-source.
docs/guides/pwa-support.md
Outdated
@@ -116,7 +116,7 @@ configure your app to be a Progressive Web App! | |||
// gasket.config.js | |||
module.exports = { | |||
plugins: { | |||
presets: ['default'], | |||
presets: ['godaddy'], |
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.
Let's use nextjs
or @gasket/nextjs-preset
as the example in these docs.
@@ -66,7 +66,7 @@ describe('create', function () { | |||
}); | |||
|
|||
it('executes expected bootstrap actions', async () => { | |||
const cmd = new CreateCommand(['myapp']); | |||
const cmd = new CreateCommand(['myapp', '--presets=godaddy']); |
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.
Use --presets=godaddy
in this file
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.
You wanted to mean nextjs
?
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 have replaced also the --preset-path
with --presets
.
@@ -88,15 +88,15 @@ module.exports = { | |||
### Short names | |||
Items in these arrays are module names. Gasket supports shorthand naming; | |||
`'mocha'` expands to `@gasket/mocha-plugin` in the `add` and `remove` arrays, | |||
`default` expands to `@gasket/default-preset` in the `presets` array. | |||
`godaddy` expands to `@gasket/godaddy-preset` in the `presets` array. | |||
|
|||
If no config file or plugin configuration is present in `gasket.config.js`, the |
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.
This should no longer be true. You can delete this section, 93-102
@@ -144,6 +144,10 @@ module.exports = function makeCreateContext(argv = [], flags = {}) { | |||
const rawPlugins = plugins.reduce(flatten, []); | |||
const pkgLinks = npmLink.reduce(flatten, []); | |||
|
|||
if (!presetPath && rawPresets.length === 0) { | |||
throw new Error('Preset or preset path not found'); |
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.
Can you look into printing out the help for the create command here? i.e. the results of running gasket help create
?
If not, rephrase this error to help the user know what to.
throw new Error('Preset or preset path not found'); | |
throw new Error('No preset was specified. Use --presets flag or run `gasket help create` for more info.'); |
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.
Also, you don't need to mention preset path
since it's a hidden dev-only flag, but you should continue to error if neither --presets or --preset-path are set as you're doing now.
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 found a way of displaying the help but not sure if it ok to use it. This is the signature of the function:
protected _help(): never;
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 have uploaded a screenshot with the new output.
Summary
No default preset supported. One preset or preset path will be required to be defined.
Screenshot updated with the error output.

Also I have replaced the
default
preset with thegodaddy
for the docs and tests. Are we going to make it public? should I use another name for it?Changelog
Test Plan
Tests added for the new scenario.