Skip to content

Commit

Permalink
build: release
Browse files Browse the repository at this point in the history
  • Loading branch information
muhamien committed Feb 7, 2024
1 parent 0ef3973 commit bdca505
Show file tree
Hide file tree
Showing 25 changed files with 407 additions and 876 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}

- name: Create @dev release
if: steps.changesets.outputs.published != 'true'
Expand All @@ -49,4 +49,4 @@ jobs:
pnpm release:dev
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ enable-pre-post-scripts=true
public-hoist-pattern[]=*tailwind-variants*
public-hoist-pattern[]=*framer-motion*
public-hoist-pattern[]=*@react-aria/interactions*
public-hoist-pattern[]=*@nextui-org/theme*
public-hoist-pattern[]=*@banyu/theme*
4 changes: 2 additions & 2 deletions packages/components/avatar/__tests__/avatar.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import {render, act} from "@testing-library/react";
import {mocks} from "@Banyu-org/test-utils";
import {mocks} from "@banyu/test-utils";

import {Avatar} from "../src";

Expand All @@ -15,7 +15,7 @@ describe("Avatar", () => {
const ref = React.createRef<HTMLDivElement>();

render(<Avatar ref={ref} />);
expect(ref.current).not.toBeNull();
expect(ref.current).not.toBeUndefined();
});

it("should populate imgRef", () => {
Expand Down
4 changes: 2 additions & 2 deletions packages/components/code/__tests__/code.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ describe("Code", () => {
});

it("should include the code", () => {
const wrapper = render(<Code data-testid="code-test">npm install @Banyu-org/react</Code>);
const wrapper = render(<Code data-testid="code-test">npm install @banyu/react</Code>);

expect(wrapper.getByTestId("code-test")).toHaveTextContent("npm install @Banyu-org/react");
expect(wrapper.getByTestId("code-test")).toHaveTextContent("npm install @banyu/react");
});
});
2 changes: 1 addition & 1 deletion packages/components/dropdown/__tests__/dropdown.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import {act, render} from "@testing-library/react";
import {Button} from "@Banyu-org/button";
import {Button} from "@banyu/button";
import userEvent from "@testing-library/user-event";

import {Dropdown, DropdownTrigger, DropdownMenu, DropdownItem, DropdownSection} from "../src";
Expand Down
26 changes: 18 additions & 8 deletions packages/components/input/__tests__/input.test.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import * as React from "react";
import {render, waitFor} from "@testing-library/react";
import {act, render, waitFor} from "@testing-library/react";

import {Input} from "../src";

// @ts-ignore
globalThis.IS_REACT_ACT_ENVIRONMENT = true;

describe("Input", () => {
it("should render correctly", () => {
const wrapper = render(<Input label="test input" />);
Expand Down Expand Up @@ -94,11 +97,14 @@ describe("Input", () => {

const {container} = render(<Input label="test input" onFocus={onFocus} />);

container.querySelector("input")?.focus();
container.querySelector("input")?.blur();
act(() => {
container.querySelector("input")?.focus();
container.querySelector("input")?.blur();
});

expect(onFocus).toHaveBeenCalledTimes(1);
});

it("ref should update the value", async () => {
const ref = React.createRef<HTMLInputElement>();

Expand All @@ -107,17 +113,21 @@ describe("Input", () => {
if (!ref.current) {
throw new Error("ref is null");
}
const value = "value";
const val = "value test";

ref.current!.value = value;
// if (ref.current!.value){
ref.current!.value = val;
// }

container.querySelector("input")?.focus();
// act(() => {
// container.querySelector("input")?.focus();
// });

await waitFor(() => {
return expect(ref.current?.value)?.toBe(value);
return expect(ref.current?.value)?.toBe(val);
});
await waitFor(() => {
return expect(ref.current?.value)?.toBe(value);
return expect(ref.current?.value)?.toBe(val);
});
});
});
5 changes: 3 additions & 2 deletions packages/components/input/src/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ const Input = forwardRef<"input", InputProps>((props, ref) => {
return (
<div {...getHelperWrapperProps()}>
{errorMessage ? (
// <div {...getErrorMessageProps()}>{errorMessage}</div>
<></>
<div {...getErrorMessageProps()}>
<>{errorMessage}</>
</div>
) : description ? (
<div {...getDescriptionProps()}>{description}</div>
) : null}
Expand Down
5 changes: 3 additions & 2 deletions packages/components/input/src/textarea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,9 @@ const Textarea = forwardRef<"textarea", TextAreaProps>(
{hasHelper ? (
<div {...getHelperWrapperProps()}>
{errorMessage ? (
// <div {...getErrorMessageProps()}>{errorMessage}</div>
<></>
<div {...getErrorMessageProps()}>
<>{errorMessage}</>
</div>
) : description ? (
<div {...getDescriptionProps()}>{description}</div>
) : null}
Expand Down
12 changes: 2 additions & 10 deletions packages/components/link/__tests__/link.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,24 +23,16 @@ describe("Link", () => {
expect(() => wrapper.unmount()).not.toThrow();
});

it('should show a link icon when "showAnchorIcon" is true', () => {
const {container} = render(
<Link showAnchorIcon href="#">
Link
</Link>,
);

expect(container.querySelector("svg")).not.toBeNull();
});

it('should have target="_blank" and rel="noopener noreferrer" when "isExternal" is true', () => {
const {container} = render(
<Link isExternal href="#">
Link
</Link>,
);

// @ts-ignore
expect(container.querySelector("a")?.rel).toBe("noopener noreferrer");
// @ts-ignore
expect(container.querySelector("a")?.target).toBe("_blank");
});

Expand Down
2 changes: 1 addition & 1 deletion packages/components/popover/__tests__/popover.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import {render, fireEvent, act} from "@testing-library/react";
import {Button} from "@Banyu-org/button";
import {Button} from "@banyu/button";

import {Popover, PopoverContent, PopoverTrigger} from "../src";

Expand Down
6 changes: 3 additions & 3 deletions packages/components/spinner/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @Banyu-org/loading
# @banyu/loading

Spinner express an unspecified wait time or display the length of a process.

Expand All @@ -7,9 +7,9 @@ Please refer to the [documentation](https://localhost:3000/docs/components/loadi
## Installation

```sh
yarn add @Banyu-org/loading
yarn add @banyu/loading
# or
npm i @Banyu-org/loading
npm i @banyu/loading
```

## Contribution
Expand Down
6 changes: 3 additions & 3 deletions packages/components/tooltip/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @Banyu-org/tooltip
# @banyu/tooltip

Tooltips display a brief, informative message that appears when a user interacts with an element.

Expand All @@ -7,9 +7,9 @@ Please refer to the [documentation](https://localhost:3000/docs/components/toolt
## Installation

```sh
yarn add @Banyu-org/tooltip
yarn add @banyu/tooltip
# or
npm i @Banyu-org/tooltip
npm i @banyu/tooltip
```

## Contribution
Expand Down
2 changes: 1 addition & 1 deletion packages/components/tooltip/__tests__/tooltip.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import {render, fireEvent, act} from "@testing-library/react";
import {Button} from "@Banyu-org/button";
import {Button} from "@banyu/button";

import {Tooltip} from "../src";

Expand Down
2 changes: 1 addition & 1 deletion packages/components/user/__tests__/user.test.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from "react";
import {render} from "@testing-library/react";
import {Link} from "@Banyu-org/link";
import {Link} from "@banyu/link";

import {User} from "../src";

Expand Down
14 changes: 7 additions & 7 deletions packages/core/theme/src/components/code.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {VariantProps} from "tailwind-variants"
import type {VariantProps} from "tailwind-variants";

import {tv} from "../utils/tv"
import {colorVariants} from "../utils"
import {tv} from "../utils/tv";
import {colorVariants} from "../utils";

/**
* Code wrapper **Tailwind Variants** component
Expand All @@ -10,7 +10,7 @@ import {colorVariants} from "../utils"
*
* @example
* <code className={classNames)}>
* npm install @Banyu-org/react
* npm install @banyu/react
* </code>
*/
const code = tv({
Expand Down Expand Up @@ -42,8 +42,8 @@ const code = tv({
size: "sm",
radius: "sm",
},
})
});

export type CodeVariantProps = VariantProps<typeof code>
export type CodeVariantProps = VariantProps<typeof code>;

export {code}
export {code};
6 changes: 3 additions & 3 deletions packages/hooks/use-aria-button/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @Banyu-org/use-aria-button
# @banyu/use-aria-button

A Quick description of the component

Expand All @@ -7,9 +7,9 @@ A Quick description of the component
## Installation

```sh
yarn add @Banyu-org/use-aria-button
yarn add @banyu/use-aria-button
# or
npm i @Banyu-org/use-aria-button
npm i @banyu/use-aria-button
```

## Contribution
Expand Down
6 changes: 3 additions & 3 deletions packages/hooks/use-aria-link/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @Banyu-org/use-aria-link
# @banyu/use-aria-link

A Quick description of the component

Expand All @@ -7,9 +7,9 @@ A Quick description of the component
## Installation

```sh
yarn add @Banyu-org/use-aria-link
yarn add @banyu/use-aria-link
# or
npm i @Banyu-org/use-aria-link
npm i @banyu/use-aria-link
```

## Contribution
Expand Down
6 changes: 3 additions & 3 deletions packages/hooks/use-is-mobile/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @Banyu-org/use-is-mobile
# @banyu/use-is-mobile

A Quick description of the component

Expand All @@ -7,9 +7,9 @@ A Quick description of the component
## Installation

```sh
yarn add @Banyu-org/use-is-mobile
yarn add @banyu/use-is-mobile
# or
npm i @Banyu-org/use-is-mobile
npm i @banyu/use-is-mobile
```

## Contribution
Expand Down
6 changes: 3 additions & 3 deletions packages/utilities/aria-utils/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @Banyu-org/aria-utils
# @banyu/aria-utils

A Quick description of the component

Expand All @@ -7,9 +7,9 @@ A Quick description of the component
## Installation

```sh
yarn add @Banyu-org/aria-utils
yarn add @banyu/aria-utils
# or
npm i @Banyu-org/aria-utils
npm i @banyu/aria-utils
```

## Contribution
Expand Down
6 changes: 3 additions & 3 deletions packages/utilities/react-rsc-utils/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @Banyu-org/react-rsc-utils
# @banyu/react-rsc-utils

A Quick description of the component

Expand All @@ -7,9 +7,9 @@ A Quick description of the component
## Installation

```sh
yarn add @Banyu-org/react-rsc-utils
yarn add @banyu/react-rsc-utils
# or
npm i @Banyu-org/react-rsc-utils
npm i @banyu/react-rsc-utils
```

## Contribution
Expand Down
6 changes: 3 additions & 3 deletions packages/utilities/react-utils/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @Banyu-org/react-utils
# @banyu/react-utils

A Quick description of the component

Expand All @@ -7,9 +7,9 @@ A Quick description of the component
## Installation

```sh
yarn add @Banyu-org/react-utils
yarn add @banyu/react-utils
# or
npm i @Banyu-org/react-utils
npm i @banyu/react-utils
```

## Contribution
Expand Down
6 changes: 3 additions & 3 deletions packages/utilities/test-utils/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# @Banyu-org/test-utils
# @banyu/test-utils

A Quick description of the component

Expand All @@ -7,9 +7,9 @@ A Quick description of the component
## Installation

```sh
yarn add @Banyu-org/test-utils
yarn add @banyu/test-utils
# or
npm i @Banyu-org/test-utils
npm i @banyu/test-utils
```

## Contribution
Expand Down
Loading

0 comments on commit bdca505

Please sign in to comment.