-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add element type prompt and adapt templates
- Added a new prompt in the `create` script to enable users to specify whether they want to generate a new component, plugin, or button. - Adapted the existing templates to correctly produce the type of element selected by the user. - Migrated the functionality of the skip-button-plugin into a simpler component format.
- Loading branch information
Showing
37 changed files
with
164 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
plugins/skip-button-plugin/test/skip-button-plugin.spec.js
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// eslint-disable-next-line max-lines-per-function | ||
export default function(plop) { | ||
// Register an equality helper | ||
plop.setHelper('ifEq', function(a, b, options) { | ||
return (a === b) ? options.fn(this) : options.inverse(this); | ||
}); | ||
|
||
plop.setGenerator('plugin', { | ||
description: 'Create a new Pillarbox elemet', | ||
prompts: [ | ||
{ | ||
type: 'list', | ||
name: 'type', | ||
message: 'What type of the element would you like to create?', | ||
choices: [ | ||
{ name: 'Plugin \x1b[90m(Extend Pillarbox functionality or add new features)\x1b[0m', value: 'Plugin' }, | ||
{ name: 'Component \x1b[90m(Manipulate or display content within the player)\x1b[0m', value: 'Component' }, | ||
{ name: 'Button \x1b[90m(Provide custom interactive functionality to the player)\x1b[0m', value: 'Button' } | ||
] | ||
}, | ||
{ | ||
type: 'input', | ||
name: 'name', | ||
message: data => `What is the name of your ${data.type}?` | ||
}, | ||
{ | ||
type: 'confirm', | ||
name: 'wantLocalization', | ||
message: 'Will your element support multiple languages?' | ||
} | ||
], | ||
actions: data => [ | ||
{ | ||
type: 'addMany', | ||
destination: '../plugins/{{kebabCase name}}', | ||
base: './template', | ||
templateFiles: './template/**', | ||
globOptions: { | ||
dot: true, | ||
ignore: !data.wantLocalization ? '**/src/lang/**' : undefined | ||
} | ||
} | ||
] | ||
}); | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.