From 51d1b870c2cfa1e4a06d425558baa6d88326a278 Mon Sep 17 00:00:00 2001 From: Luke Walton Date: Wed, 4 Dec 2024 12:38:05 +0000 Subject: [PATCH] chore: updating other files --- .github/CODEOWNERS | 2 +- .storybook/extractArgs.ts | 57 +++++++++++++++++++++++++++------------ CODE_OF_CONDUCT | 57 +++++++++++++++++++++++++++++++++++++++ CONTRIBUTING | 7 ++--- catalog-info.yaml | 6 ++--- package.json | 3 ++- 6 files changed, 107 insertions(+), 25 deletions(-) create mode 100644 CODE_OF_CONDUCT diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 7f890c5..d292fdf 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @benken @thelukewalton @mikecoomber \ No newline at end of file +* @ZebraDevs/front-end-devs \ No newline at end of file diff --git a/.storybook/extractArgs.ts b/.storybook/extractArgs.ts index e54718f..f1e22ff 100644 --- a/.storybook/extractArgs.ts +++ b/.storybook/extractArgs.ts @@ -1,7 +1,7 @@ /** * Adapted from cem-plugin-better-lit-types: https://github.com/Uscreen-video/cem-plugin-better-lit-types. - * - * See LICENSE_3RD_PARTY file for license information. + * + * See LICENSE_3RD_PARTY for license information. */ import { reduceTypes } from "cem-plugin-better-lit-types/storybook"; @@ -23,7 +23,10 @@ export default (manifest, mapArgs?) => (componentName) => { Object.assign( Object.assign( Object.assign( - Object.assign({}, reduceTypes(declaration.attributes, FIELD.attributes, mapArgs)), + Object.assign( + {}, + reduceTypes(declaration.attributes, FIELD.attributes, mapArgs) + ), reduceTypes(declaration.members, FIELD.properties, mapArgs) ), reduceTypes(declaration.slots, FIELD.slots, mapArgs) @@ -43,25 +46,39 @@ export default (manifest, mapArgs?) => (componentName) => { ) { const name = f!["name"] === "default" ? "" : f!["name"]; if (declaration["slots"].some((e) => e["name"] === name)) { - const decValue = declaration["slots"].find((e) => e["name"] === name); + const decValue = declaration["slots"].find( + (e) => e["name"] === name + ); if (decValue["type"]) f!["type"] = decValue["type"]; } } /** Move value of `type.text` to `type`. */ - if (f!["type"] && f!["type"]["text"] && !f!["type"]["text"].includes("boolean")) { + if ( + f!["type"] && + f!["type"]["text"] && + !f!["type"]["text"].includes("boolean") + ) { f!["type"] = f!["type"]["text"]; } /** Set values for boolean */ - if (f!["type"] && f!["type"]["text"] && f!["type"]["text"].includes("boolean")) { + if ( + f!["type"] && + f!["type"]["text"] && + f!["type"]["text"].includes("boolean") + ) { f!["type"] = "boolean"; f!["control"] = { type: "boolean" }; } /** Set controls for plain strings. */ - if (f!["type"] && typeof f!["type"] === "string" && f!["type"].includes("string")) { + if ( + f!["type"] && + typeof f!["type"] === "string" && + f!["type"].includes("string") + ) { f!["control"] = { type: "text" }; } @@ -113,6 +130,7 @@ const getEvents = (declaration, args) => { return args; }; + /** * Gets the declaration for a component based on its manifest and tagName. * @param {object} manifest - The component's manifest. @@ -125,18 +143,23 @@ export const getDeclaration = (manifest, tagName, type = "") => { let _declaration; const finder = type === "mixin" ? "name" : "tagName"; - (_a = manifest === null || manifest === void 0 ? void 0 : manifest.modules) === null || _a === void 0 + (_a = + manifest === null || manifest === void 0 ? void 0 : manifest.modules) === + null || _a === void 0 ? void 0 : _a.forEach((_module) => { - var _a; - (_a = _module === null || _module === void 0 ? void 0 : _module.declarations) === null || _a === void 0 + var _a; + (_a = + _module === null || _module === void 0 ? void 0 - : _a.forEach((declaration) => { - if (declaration[finder] === tagName) { - _declaration = declaration; - } - }); - }); + : _module.declarations) === null || _a === void 0 + ? void 0 + : _a.forEach((declaration) => { + if (declaration[finder] === tagName) { + _declaration = declaration; + } + }); + }); return _declaration; -}; +}; \ No newline at end of file diff --git a/CODE_OF_CONDUCT b/CODE_OF_CONDUCT new file mode 100644 index 0000000..cf6d6f0 --- /dev/null +++ b/CODE_OF_CONDUCT @@ -0,0 +1,57 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to a positive environment include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery, and sexual attention or + advances of any kind +- Trolling, insulting or derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or email + address, without their explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. +Representation of a project may be further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +Devrel@zebra.com. +All complaints will be reviewed and investigated promptly and fairly. +The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the Contributor Covenant, +version 2.0, available at +https://www.contributor-covenant.org/version/2/0/code_of_conduct.html. diff --git a/CONTRIBUTING b/CONTRIBUTING index 1f43244..cd76b9e 100644 --- a/CONTRIBUTING +++ b/CONTRIBUTING @@ -25,6 +25,7 @@ Before a PR can be reviewed, ensure you have done the following, and fixed any i - Check formatting: `npm run lint` - Run unit-tests: `npm run test` +Once a PR is opened, review is required by the Codeowners. It is also required that all status checks pass before a PR can be merged. ## Documentation @@ -33,12 +34,12 @@ All parameters, attributes and slots should be documented with brief description Once code is written, all components should have a story written in Storybook. Single components can use autodocs to create their documentation, but for complex components we may need to create the markdown. We must run `npm run analyze` before writing stories, as this updates [custom-elements.json](./custom-elements.json) which storybook uses. -To create a story, first create a directory under `src/stories` for the component. +To create a story, first create a directory under `src/stories` for the component. In storybook, always add the `title` parameter as this is used in documentation. For single components, we should add `tags:['autodocs']` to storybook to generate the documentation. For complex components, we should create a folder within `src/stories` for this component. In this directory, we create all stories needed and add the same `title` to all. -Then create a `Docs.mdx` file in this folder, alongside all the stories. -Within this we need to import the stories, and the blocks from storybook - see [Badges](./src/stories/Badges/Docs.mdx) for an example. We can then display the canvas, description and ArgTypes for all the components. \ No newline at end of file +Then create a `Docs.mdx` file in this folder, alongside all the stories. +Within this we need to import the stories, and the blocks from storybook - see [Badges](./src/stories/Badges/Docs.mdx) for an example. We can then display the canvas, description and ArgTypes for all the components. diff --git a/catalog-info.yaml b/catalog-info.yaml index 81a03c0..dbe0a5c 100644 --- a/catalog-info.yaml +++ b/catalog-info.yaml @@ -11,13 +11,13 @@ metadata: title: Storybook - url: https://design-zebra.web.app/web/tsdoc/ title: TSDoc -# - url: https://npmjs.com/package/@zebra/zeta-web -# title: npm + - url: https://npmjs.com/package/@zebra-fed/zeta-web + title: npm tags: - typescript - web-components annotations: - github.com/project-slug: zebratechnologies/zeta-web + github.com/project-slug: ZebraDevs/zeta-web github.com/team-slug: zebratechnologies/front-end-development # backstage.io/techdocs-ref: dir:. spec: diff --git a/package.json b/package.json index 7007d7f..e2b2283 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,8 @@ "files": [ "dist", "custom-elements.json", - "assets" + "assets", + "LICENSE-3RD-PARTY" ], "main": "./dist/index.js", "module": "./dist/index.js",