You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(create-webcomponents-package): fix package creation issues with test and lint (#6976)
The change addresses few issues when generating a web component project with our tools:
### Command `@ui5/webcomponents-package` updated
- added new parameter `componentName` and derive the tag name from it
- added new (private) parameter `skipSubFolder` to generate all files in the execution context, not in a new folder (defined by the packageName parameter) as by default
### Command `create-web-component` updated
- remove the "typescript" parameter and just check for the existence of `tsconfig.json` to generate TS or JS component.
- update "componentName" validation to allow only letters, starting with capital one - Foo, FooBar, FooBarBar
- remove "tag" parameter, the tag is now produced based on the component name - "foo-tag", "foo-bar", "foo-bar-bar"
### The `test` command
- fixes failing `yarn test` command due to a bug in `test-runner.js`
### Themes updated
- no longer showcase "belize", "horizon" is now used in the test page instead
### Eslint improved
- added eslint config file pointing to the default config in `@ui5/webcomponents-tools`
Fixes: #6980
Copy file name to clipboardexpand all lines: packages/create-package/README.md
+2-1
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,8 @@ Usage:
18
18
19
19
Options:
20
20
--name <string> - defines the package name
21
-
--tag <string> - defines the tag name of the sample web component that will be created in your new package
21
+
--componentName <string> - defines the component class name that will be created in your new package
22
+
--tag <string> - defines the tag name of the sample web component that will be created in your new package. The tag will be derived from the component name if not provided.
22
23
--enable-typescript - enables TypeScript support for the package
23
24
--skip - skips configuration and generates package with a default value for each parameter that wasn't passed
validate: (value)=>isNameValid(value) ? true : "Package name should be a string, starting with a letter and containing the following symbols [a-z, A-Z ,0-9, _, -].",
thrownewError("Invalid component name. Please use only letters, numbers, dashes and underscores. The first character must be a letter.");
87
-
}
88
-
89
-
if(tagName&&!isTagNameValid(tagName)){
90
-
thrownewError("Invalid tag name. The tag name should only contain lowercase letters, numbers, dashes, and underscores. The first character must be a letter, and it should follow the pattern 'tag-name'.");
0 commit comments