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

Fix-codeclimate #2

Merged
merged 4 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
- name: Publish package with long name for better SEO
continue-on-error: true
run: |
npm cache clean
cd dist
sed -i -e "s/.*name.*/\t\"name\": \"react18-global-store\",/" package.json
npm publish --provenance --access public
8 changes: 8 additions & 0 deletions examples/nextjs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# nextjs-example

## 0.0.1

### Patch Changes

- Updated dependencies
- [email protected]
- [email protected]

## 1.0.5

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nextjs-example",
"version": "0.0.0",
"version": "0.0.1",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
8 changes: 8 additions & 0 deletions examples/remix/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# remix-example

## 0.0.1

### Patch Changes

- Updated dependencies
- [email protected]
- [email protected]

## null

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/remix/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remix-example",
"version": "0.0.0",
"version": "0.0.1",
"private": true,
"sideEffects": false,
"type": "module",
Expand Down
8 changes: 8 additions & 0 deletions examples/vite/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# vite-example

## 0.0.1

### Patch Changes

- Updated dependencies
- [email protected]
- [email protected]

## 0.0.5

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/vite/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vite-example",
"private": true,
"version": "0.0.0",
"version": "0.0.1",
"type": "module",
"scripts": {
"dev": "vite --port 3001",
Expand Down
7 changes: 7 additions & 0 deletions lib/r18gs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# r18gs

## 0.0.1

### Patch Changes

- Fix publish setup
2 changes: 1 addition & 1 deletion lib/r18gs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "r18gs",
"author": "Mayank Kumar Chaudhari <https://mayank-chaudhari.vercel.app>",
"private": false,
"version": "0.0.0",
"version": "0.0.1",
"description": "A simple yet elegant, light weight, react18 global store to replace Zustand for better tree shaking.",
"main": "./index.ts",
"types": "./index.ts",
Expand Down
2 changes: 1 addition & 1 deletion lib/r18gs/scope.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
const fs = require("node:fs");
const path = require("node:path");

const owner = process.env.OWNER;
const owner = "mayank1513";
const packageJson = require(path.resolve(process.cwd(), "package.json"));
const ref = packageJson.name;
if (!ref.startsWith(`@${owner}`)) {
Expand Down
2 changes: 1 addition & 1 deletion lib/r18gs/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import useRGS from "./use-rgs";

export default useRGS;
export default useRGS;
5 changes: 1 addition & 4 deletions lib/r18gs/src/use-rgs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ globalThis.rgs = {};
* const [state, setState] = useRGS<number>("counter", 1);
* ```
*/
export default function useRGS<T>(
key: string,
value?: T,
): [T, (val: SetterArgType<T>) => void] {
export default function useRGS<T>(key: string, value?: T): [T, (val: SetterArgType<T>) => void] {
const setRGState = useCallback(
(val: SetterArgType<T>) => {
const rgs = globalThis.rgs[key] as React18GlobalStore;
Expand Down
18 changes: 18 additions & 0 deletions packages/shared-ui/src/cards/card.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import styles from "./cards.module.css";

interface CardProps {
href: string;
title: string;
description: string;
}

export function Card({ href, title, description }: CardProps) {
return (
<a className={styles.card} href={href} rel="noopener noreferrer" target="_blank">
<h2>
{title} <span>-&gt;</span>
</h2>
<p>{description}</p>
</a>
);
}
16 changes: 0 additions & 16 deletions packages/shared-ui/src/cards/docs-card.tsx

This file was deleted.

16 changes: 0 additions & 16 deletions packages/shared-ui/src/cards/examples-card.tsx

This file was deleted.

21 changes: 17 additions & 4 deletions packages/shared-ui/src/cards/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
import { ExamplesCard } from "./examples-card";
import styles from "./cards.module.css";
import { StarMeCard } from "./star-me-card";
import { DocsCard } from "./docs-card";
import { Card } from "./card";

const cards = [
{
href: "https://react18-tools.github.io/r18gs/",
title: "Docs",
description: "Explore the official docs.",
},
{
href: "https://github.com/react18-tools/r18gs",
title: "More Examples",
description: "Explore more examples on official GitHub Repo.",
},
];

export function Cards() {
return (
<div className={styles.cards}>
<DocsCard />
<ExamplesCard />
{cards.map(card => (
<Card key={card.href} {...card} />
))}
<StarMeCard />
</div>
);
Expand Down
Loading