-
Notifications
You must be signed in to change notification settings - Fork 9
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
Update Package Generator for NIM - updated way of handling the package generation. #168
Merged
pszczesniak
merged 19 commits into
cc/6190-update-package-generator
from
new-changes-implementation-in-package-generator
Jun 19, 2024
Merged
Changes from 8 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
ef70c63
Change the flag name from '--use-only-new-installation-methods' to '-…
pszczesniak 68b8dfa
Remove log.
pszczesniak 1637990
Tests.
pszczesniak b72d328
Update 'ckeditor5' dependencies in templates.
pszczesniak 8f96042
Remove logs.
pszczesniak ecc1a74
Remove old dependencies of ckeditor5 packages in legacy ts template.
pszczesniak 70dd271
Added infobox with the link to the guide when current and legacy inst…
pszczesniak 0382618
Tests coverage back to 100%.
pszczesniak 12beda7
Extend tsconfig for ts templates to prevent imports without extensions.
pszczesniak 13abbf5
Removed unnecessary eslint rules.
pszczesniak 38934e0
Added missing import extensions and needed fixes to handle it correctly.
pszczesniak ff0c76e
Add eslint rule 'allow-imports-only-from-main-package-entry-point'.
pszczesniak 667a4a8
Unify tsconfigs intendation type and size.
pszczesniak f3f1d51
Add eslint rule 'require-file-extensions-in-imports'.
pszczesniak 3767f0f
Add eslint rules also to ts templates and add comments to them.
pszczesniak 0434f8b
Added 'exports' in 'package.json' files inside legacy templates.
pszczesniak 93f58fd
Update eslint config and add new rule for NIM templates.
pszczesniak 61a4af4
Added link to documentation about supporting multiple versions of CKE…
pszczesniak 4a0a6f5
Code review fixes.
pszczesniak File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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
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
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
51 changes: 51 additions & 0 deletions
51
packages/ckeditor5-package-generator/lib/utils/choose-installation-methods.js
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,51 @@ | ||
/** | ||
* @license Copyright (c) 2020-2024, CKSource Holding sp. z o.o. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
const { prompt } = require( 'inquirer' ); | ||
|
||
const INSTALLATION_METHODS = [ | ||
{ | ||
value: 'current', | ||
displayName: 'Current (v42.0.0+) [recommended]' | ||
}, | ||
{ | ||
value: 'current-and-legacy', | ||
displayName: 'Current and legacy methods with DLLs (pre-42.0.0). [⚠️ Requires additional work with imports. See: <link>]' | ||
} | ||
]; | ||
|
||
/** | ||
* Chooses installation method. If --installation-methods option us used, and it has valid value, that is returned. | ||
* Otherwise, ask user to choose from available installation methods. | ||
* | ||
* @param {Logger} logger | ||
* @param {String} method | ||
* @returns {Promise<String>} | ||
*/ | ||
module.exports = async function chooseIn( logger, method ) { | ||
if ( method ) { | ||
const methodShorthands = INSTALLATION_METHODS.map( ( { value } ) => value ); | ||
|
||
if ( methodShorthands.includes( method ) ) { | ||
return method; | ||
} | ||
|
||
logger.error( | ||
`--installation-methods option has to be one of: ${ methodShorthands.join( ', ' ) }. Falling back to manual choice.` | ||
); | ||
} | ||
|
||
const { installationMethod } = await prompt( [ { | ||
prefix: '📍', | ||
name: 'installationMethod', | ||
message: 'Which installation methods of CKEditor 5 do you want to support?', | ||
type: 'list', | ||
choices: INSTALLATION_METHODS.map( ( { displayName } ) => displayName ) | ||
} ] ); | ||
|
||
return INSTALLATION_METHODS.find( p => p.displayName === installationMethod ).value; | ||
}; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
In order to avoid changing the box manually in the future when we want to change displayed text, please use the table package in order to generate the box dynamically.
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.
An example:
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.
IMO the cost of maintaining this is low, and the
table
plugin comes with 17 other dependencies. That's quite a lot of dependencies for drawing a table.https://npmgraph.js.org/?q=table