Skip to content
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

DLLs: Allow normal package names #139

Closed
tony opened this issue Mar 14, 2023 · 0 comments · Fixed by #145
Closed

DLLs: Allow normal package names #139

tony opened this issue Mar 14, 2023 · 0 comments · Fixed by #145
Assignees
Labels
squad:devops Issue to be handled by the Devops team. type:bug This issue reports a buggy (incorrect) behavior.
Milestone

Comments

@tony
Copy link

tony commented Mar 14, 2023

📝 Provide detailed reproduction steps (if any)

In the community package ckeditor5-math (github), the package name errors on ckeditor5-package-tools dll:build

This happened in a recent PR: https://github.com/isaul32/ckeditor5-math/pull/83/files#r1134754172

✔️ Expected result

The package should correctly build a DLL package, but errors

❌ Actual result

yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
success Already up-to-date.
$ yarn run dll:build
yarn run v1.22.19
$ ckeditor5-package-tools dll:build
ckeditor5-math/node_modules/@ckeditor/ckeditor5-package-tools/lib/utils/get-webpack-config-dll.js:23
        const dllName = packageJson.name.split( '/' )[ 1 ].replace( /^ckeditor5-/, '' );
                                                          ^

TypeError: Cannot read properties of undefined (reading 'replace')
    at module.exports (ckeditor5-math/node_modules/@ckeditor/ckeditor5-package-tools/lib/utils/get-webpack-config-dll.js:23:52)
    at module.exports (ckeditor5-math/node_modules/@ckeditor/ckeditor5-package-tools/lib/tasks/dll-build.js:12:24)
    at dll:build (ckeditor5-math/node_modules/@ckeditor/ckeditor5-package-tools/lib/index.js:18:45)
    at Object.<anonymous> (ckeditor5-math/node_modules/@ckeditor/ckeditor5-package-tools/bin/index.js:18:32)
    at Module._compile (node:internal/modules/cjs/loader:1246:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1300:10)
    at Module.load (node:internal/modules/cjs/loader:1103:32)
    at Module._load (node:internal/modules/cjs/loader:942:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
    at node:internal/main/run_main_module:23:47

❓ Possible solution

Make the split('/')[1] optional here if there's no org prefix:

const dllName = packageJson.name.split( '/' )[ 1 ].replace( /^ckeditor5-/, '' );

📃 Other details

  • Node: 16
  • Npm / Yarn: 1.22
  • First affected version

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@tony tony added the type:bug This issue reports a buggy (incorrect) behavior. label Mar 14, 2023
tony added a commit to tony/ckeditor5-math that referenced this issue Mar 14, 2023
tony added a commit to isaul32/ckeditor5-math that referenced this issue Mar 14, 2023
@pomek pomek added the squad:devops Issue to be handled by the Devops team. label Apr 7, 2023
@CKEditorBot CKEditorBot added the status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. label Apr 12, 2023
@przemyslaw-zan przemyslaw-zan self-assigned this Apr 13, 2023
@CKEditorBot CKEditorBot added status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. and removed status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. labels Apr 13, 2023
pomek added a commit that referenced this issue Apr 13, 2023
Fix (tools): Added support for a package name without an organization prefix. Preparing the DLL build will not throw an error for such a package. Closes #139.
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Apr 13, 2023
@CKEditorBot CKEditorBot added this to the iteration 62 milestone Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
squad:devops Issue to be handled by the Devops team. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
4 participants