-
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
Update Package Generator for NIM - updated way of handling the package generation. #168
Conversation
…-installation-methods' and add prompt to choose the installation method.
…allation methods were chosen.
@@ -195,13 +193,18 @@ function startDevelopmentServer( cwd ) { | |||
sampleServer.stdout.on( 'data', data => { | |||
const content = stripAnsiEscapeCodes( data.toString() ).slice( 0, -1 ); | |||
const endMatch = /webpack \d+\.\d+\.\d+ compiled successfully in \d+ ms/.test( content ); | |||
const errorMatch = content.indexOf( 'ERROR' ) !== -1; |
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.
When there are some errors in sample/*
files, after the server starts, there is no information what is going.
I've added a naive error handler it; helped me few times while debugging.
@@ -66,6 +68,18 @@ module.exports = async function init( packageName, options ) { | |||
'Example: ' + chalk.gray( packageManager + ' run start' ), | |||
'' | |||
].join( '\n' ), { startWithNewLine: true } ); | |||
|
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:
const tableData = [
[ '' ],
[ 'Supporting a wider range of CKEditor 5 versions requires using' ],
[ 'a more complex method of importing modules from CKEditor 5.' ],
[ '' ],
[ 'Read more here: <LINK TO THE GUIDE EXPLAINING THIS></LINK>' ],
[ '' ]
];
const tableConfig = {
columns: [ {
paddingLeft: 2,
paddingRight: 2
} ],
singleLine: true,
border: {
topLeft: '╭',
topRight: '╮',
bottomLeft: '╰',
bottomRight: '╯',
topBody: '─',
bottomBody: '─',
bodyLeft: '│',
bodyRight: '│'
}
};
logger.info( table( tableData, tableConfig ), { startWithNewLine: true } );
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.
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.
Update: I did not use the --dev
flag, with it, it works as expected.
TS packages do not work:
Options: yarn, TS, Current and legacy methods with DLLs.
Result: Error thrown while creating the package.
Options: yarn, TS, Current methods
Result: Error thrown while running yarn start
in the created package.
ERROR in ./src/index.ts 3:0-50
Module not found: Error: Can't resolve './gentest.js' in 'D:\Repositories\ckeditor5-gentest\src'
resolve './gentest.js' in 'D:\Repositories\ckeditor5-gentest\src'
using description file: D:\Repositories\ckeditor5-gentest\package.json (relative path: ./src)
Field 'browser' doesn't contain a valid alias configuration
using description file: D:\Repositories\ckeditor5-gentest\package.json (relative path: ./src/gentest.js)
no extension
Field 'browser' doesn't contain a valid alias configuration
D:\Repositories\ckeditor5-gentest\src\gentest.js doesn't exist
.ts
Field 'browser' doesn't contain a valid alias configuration
D:\Repositories\ckeditor5-gentest\src\gentest.js.ts doesn't exist
.js
Field 'browser' doesn't contain a valid alias configuration
D:\Repositories\ckeditor5-gentest\src\gentest.js.js doesn't exist
.json
Field 'browser' doesn't contain a valid alias configuration
D:\Repositories\ckeditor5-gentest\src\gentest.js.json doesn't exist
.wasm
Field 'browser' doesn't contain a valid alias configuration
D:\Repositories\ckeditor5-gentest\src\gentest.js.wasm doesn't exist
as directory
D:\Repositories\ckeditor5-gentest\src\gentest.js doesn't exist
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.
LGTM 👍
06fa2b7
into
cc/6190-update-package-generator
Suggested merge commit message (convention)
Type (scope): Message. Closes ckeditor/ckeditor5#16543.
Additional information
After merge to branch
cc/6190-update-package-generator
please remember to update the commit message in this PR:Feature (generator): New flag
--installation-methods
that should allow to generate package with current installation methods of CKEditor 5 or with current and legacy methods with DLLs. See ckeditor/ckeditor5#15502, ckeditor/ckeditor5#15739Link to guide should be added.
Supported scopes
generator
→ https://www.npmjs.com/package/ckeditor5-package-generator*
→ https://www.npmjs.com/package/@ckeditor/ckeditor5-package-*