diff --git a/.eslintrc.js b/.eslintrc.js index c7038c13..f2b81c02 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,17 +1,15 @@ module.exports = { parser: "@typescript-eslint/parser", - plugins: [ - "@typescript-eslint" - ], + plugins: ["@typescript-eslint"], extends: [ "eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended" + "plugin:@typescript-eslint/recommended", ], env: { - node: true + node: true, }, rules: { - "no-console": ["error", {"allow": ["warn"]}] - } -} \ No newline at end of file + "no-console": ["error", { allow: ["warn"] }], + }, +}; diff --git a/.github/workflows/code-quality.yaml b/.github/workflows/code-quality.yaml new file mode 100644 index 00000000..303fdf9b --- /dev/null +++ b/.github/workflows/code-quality.yaml @@ -0,0 +1,43 @@ +name: Code Quality +on: [push] + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +env: + CI: true + +jobs: + publish-packages: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Configure CI Git User + run: | + git config --global user.name 'Rajat Saxena' + git config --global user.email 'hi@sub.rajatsaxena.dev' + git remote set-url origin https://$GITHUB_ACTOR:$GITHUB_PAT@github.com/codelitdev/medialit + env: + GITHUB_PAT: ${{ secrets.PAT }} + + - name: Checkout and pull branch + run: git checkout "${GITHUB_REF:11}" && git pull + + - name: Install pnpm + run: | + npm i pnpm@latest -g + + - name: Install dependencies + run: pnpm install + + - name: Run lint + run: pnpm lint + + - name: Run prettier + run: pnpm prettier + + - name: Run test + run: pnpm test \ No newline at end of file diff --git a/.prettierignore b/.prettierignore index 76add878..f222cd41 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,3 @@ node_modules -dist \ No newline at end of file +dist +**/.next \ No newline at end of file diff --git a/apps/api/__tests__/apikey/handlers.test.ts b/apps/api/__tests__/apikey/handlers.test.ts new file mode 100644 index 00000000..2b4a536f --- /dev/null +++ b/apps/api/__tests__/apikey/handlers.test.ts @@ -0,0 +1,44 @@ +import test, { afterEach, describe, mock } from "node:test"; +import { createApikey } from "../../lib/apikey/handlers"; +import assert from "node:assert"; +import queries from "../../lib/apikey/queries"; + +describe("API key test suite", () => { + afterEach(() => { + mock.restoreAll(); + }); + + test("Create API key throws an error if name is empty", async (t) => { + const req = { + body: {}, + }; + const res = { + status: () => ({ + json: (data: any) => data, + }), + }; + const response = await createApikey(req, res, () => {}); // eslint-disable-line @typescript-eslint/no-empty-function + assert.strictEqual(response.error, "Name is required"); + }); + + test("Create API succeeds if name is provided", async (t) => { + const req = { + body: { + name: "Test API", + }, + user: { + id: "123", + }, + }; + const res = { + status: () => ({ + json: (data: any) => data, + }), + }; + mock.method(queries, "createApiKey").mock.mockImplementation( + async () => ({ key: "123" }) + ); + const response = await createApikey(req, res, () => {}); // eslint-disable-line @typescript-eslint/no-empty-function + assert.strictEqual(response.key, "123"); + }); +}); diff --git a/apps/api/__tests__/core.test.js b/apps/api/__tests__/core.test.js deleted file mode 100644 index 5b723152..00000000 --- a/apps/api/__tests__/core.test.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; - -const core = require(".."); - -describe("core", () => { - it("needs tests"); -}); diff --git a/apps/api/lib/apikey/handlers.ts b/apps/api/lib/apikey/handlers.ts index df440bb3..3e4ccf8a 100644 --- a/apps/api/lib/apikey/handlers.ts +++ b/apps/api/lib/apikey/handlers.ts @@ -1,6 +1,6 @@ import logger from "../services/log"; import { NOT_FOUND, SUCCESS } from "../config/strings"; -import { createApiKey, deleteApiKey, getApiKeyByUserId } from "./queries"; +import queries, { deleteApiKey, getApiKeyByUserId } from "./queries"; import { Apikey } from "@medialit/models"; export async function createApikey( @@ -14,7 +14,7 @@ export async function createApikey( } try { - const apikey: Apikey = await createApiKey(req.user.id, name); + const apikey: Apikey = await queries.createApiKey(req.user.id, name); return res.status(200).json({ key: apikey.key, diff --git a/apps/api/lib/apikey/queries.ts b/apps/api/lib/apikey/queries.ts index 14a1563f..3f90ccaa 100644 --- a/apps/api/lib/apikey/queries.ts +++ b/apps/api/lib/apikey/queries.ts @@ -59,3 +59,10 @@ export async function deleteApiKey( userId, }); } + +export default { + createApiKey, + getApiKeyUsingKeyId, + getApiKeyByUserId, + deleteApiKey, +}; diff --git a/apps/api/lib/user/__test__/queries.test.js b/apps/api/lib/user/__test__/queries.test.js index e7ac6d84..e69de29b 100644 --- a/apps/api/lib/user/__test__/queries.test.js +++ b/apps/api/lib/user/__test__/queries.test.js @@ -1,98 +0,0 @@ -const test = require("node:test"); -const assert = require("node:assert/strict"); -const { getUser } = require("../queries"); // Adjust the path accordingly -const UserModel = require("../model"); // Import your actual user model - -// Mock UserModel -const mockUserModel = { - findById: async (id) => { - // Mock user object with the specified fields - return { - _id: id, - email: "mock@example.com", - active: true, - name: "Mock User", - }; - }, -}; - -test("should return a valid userId", async (t) => { - const validUserId = "12345abcd"; - - const user = await mockUserModel.findById(validUserId); - - const result = await getUser(validUserId); - assert.strictEqual(typeof result.id, "string", "UserId should be a string"); - assert.deepStrictEqual(result.id, user.id); -}); - -test("should return a invalid userId", async (t) => { - const validUserId = "12345efgh"; - - const user = await mockUserModel.findById(validUserId); - - const result = await getUser(validUserId); - // assert.strictEqual(retrievedUser.id, existingUserId); - assert.notDeepStrictEqual(result.id, user.id); -}); - -// describe('getUser function', () => { -// it('should return a user when a valid ID is provided', async () => { -// // Arrange -// const userId = 'validUserId'; - -// // Mock the findById method -// const originalFindById = UserModel.findById; -// UserModel.findById = async (id) => mockUserModel.findById(id); - -// // Act -// const result = await getUser(userId); - -// // Assert -// assert.deepStrictEqual(result, { -// _id: userId, -// email: 'mock@example.com', -// active: true, -// name: 'Mock User', -// }); - -// // Restore the original method -// UserModel.findById = originalFindById; -// }); - -// it('should return null when an invalid ID is provided', async () => { -// // Arrange -// const invalidUserId = 'invalidUserId'; - -// // Mock the findById method -// const originalFindById = UserModel.findById; -// UserModel.findById = async (id) => null; - -// // Act -// const result = await getUser(invalidUserId); - -// // Assert -// assert.strictEqual(result, null); - -// // Restore the original method -// UserModel.findById = originalFindById; -// }); - -// it('should handle errors and reject the promise', async () => { -// // Arrange -// const errorUserId = 'errorUserId'; -// const errorMessage = 'An error occurred'; - -// // Mock the findById method -// const originalFindById = UserModel.findById; -// UserModel.findById = async (id) => { -// throw new Error(errorMessage); -// }; - -// // Act & Assert -// await assert.rejects(async () => await getUser(errorUserId), { message: errorMessage }); - -// // Restore the original method -// UserModel.findById = originalFindById; -// }); -// }); diff --git a/apps/api/package.json b/apps/api/package.json index 07d75172..412ed87b 100644 --- a/apps/api/package.json +++ b/apps/api/package.json @@ -27,7 +27,8 @@ "scripts": { "build": "tsc", "dev": "nodemon lib/index.ts", - "start": "node dist/index.js" + "start": "node dist/index.js", + "test": "node --import tsx --test **/*.test.ts" }, "dependencies": { "@aws-sdk/client-s3": "^3.55.0", @@ -67,6 +68,7 @@ "eslint": "^8.12.0", "nodemon": "^2.0.15", "ts-node": "^10.7.0", + "tsx": "^4.7.0", "typescript": "^5.2.2" } } diff --git a/apps/web/app/dashboard/app/[name]/files/loading.tsx b/apps/web/app/dashboard/app/[name]/files/loading.tsx index 1f49d72b..88861e00 100644 --- a/apps/web/app/dashboard/app/[name]/files/loading.tsx +++ b/apps/web/app/dashboard/app/[name]/files/loading.tsx @@ -1,9 +1,7 @@ -import React from 'react' +import React from "react"; const Loading = () => { - return ( -
Loading...
- ) -} + return
Loading...
; +}; -export default Loading \ No newline at end of file +export default Loading; diff --git a/apps/web/app/dashboard/app/[name]/tabs.tsx b/apps/web/app/dashboard/app/[name]/tabs.tsx index 5c634a4f..09e1d700 100644 --- a/apps/web/app/dashboard/app/[name]/tabs.tsx +++ b/apps/web/app/dashboard/app/[name]/tabs.tsx @@ -4,11 +4,7 @@ import React from "react"; import Link from "next/link"; import { usePathname } from "next/navigation"; -export default async function Tabs({ - params, -}: { - params: { name: string }; -}) { +export default async function Tabs({ params }: { params: { name: string } }) { const name = params.name; const currentPathName = usePathname(); diff --git a/apps/web/app/dashboard/loading.tsx b/apps/web/app/dashboard/loading.tsx index 1f49d72b..88861e00 100644 --- a/apps/web/app/dashboard/loading.tsx +++ b/apps/web/app/dashboard/loading.tsx @@ -1,9 +1,7 @@ -import React from 'react' +import React from "react"; const Loading = () => { - return ( -
Loading...
- ) -} + return
Loading...
; +}; -export default Loading \ No newline at end of file +export default Loading; diff --git a/apps/web/app/dashboard/new-app-button.tsx b/apps/web/app/dashboard/new-app-button.tsx index 9df1a68c..b7c7a8d0 100644 --- a/apps/web/app/dashboard/new-app-button.tsx +++ b/apps/web/app/dashboard/new-app-button.tsx @@ -34,59 +34,66 @@ export default function NewApp() { useEffect(() => { if (apiKeyFormState.success) { - setOpen(false) - router.refresh() + setOpen(false); + router.refresh(); toast({ title: `Success`, description: `App ${apiKey} is ready to go`, - action: { - router.push(`/dashboard/app/${encodeURIComponent(apiKey)}/files`); - }}>Go to app + action: ( + { + router.push( + `/dashboard/app/${encodeURIComponent( + apiKey + )}/files` + ); + }} + > + Go to app + + ), }); } }, [apiKeyFormState.success]); return ( - - - - - - - Create new app - -
-
- {apiKeyFormState.error && ( -

- {apiKeyFormState.error} -

- )} -
- - setApiKey(e.target.value)} - /> -
+ + + + + + + Create new app + + +
+ {apiKeyFormState.error && ( +

+ {apiKeyFormState.error} +

+ )} +
+ + setApiKey(e.target.value)} + />
- - - Create - - - - -
+
+ + Create + + +
+
); } @@ -100,11 +107,7 @@ function Submit({ const status = useFormStatus(); return ( - ); diff --git a/apps/web/app/dashboard/page.tsx b/apps/web/app/dashboard/page.tsx index 5e7a84d6..56fd7fe8 100644 --- a/apps/web/app/dashboard/page.tsx +++ b/apps/web/app/dashboard/page.tsx @@ -3,7 +3,7 @@ import { getApiKeys } from "./actions"; import { redirect } from "next/navigation"; import Link from "next/link"; import NewApp from "@/app/dashboard/new-app-button"; - + export default async function Dashboard() { const session = await auth(); diff --git a/apps/web/app/docs/page.tsx b/apps/web/app/docs/page.tsx index ad5fe640..d269ef71 100644 --- a/apps/web/app/docs/page.tsx +++ b/apps/web/app/docs/page.tsx @@ -1,11 +1,11 @@ -import React from 'react' +import React from "react"; const Docs = () => { - return ( - <> -
Docs page
- - ) -} + return ( + <> +
Docs page
+ + ); +}; -export default Docs \ No newline at end of file +export default Docs; diff --git a/apps/web/app/layout.tsx b/apps/web/app/layout.tsx index dd9b1c8c..ee887e56 100644 --- a/apps/web/app/layout.tsx +++ b/apps/web/app/layout.tsx @@ -3,7 +3,7 @@ import { Inter } from "next/font/google"; import "./globals.css"; import { NavBar } from "../components/nav-bar"; import Footer from "../components/Footer"; -import { Toaster } from "@/components/ui/toaster" +import { Toaster } from "@/components/ui/toaster"; const inter = Inter({ subsets: ["latin"] }); @@ -29,4 +29,4 @@ export default async function RootLayout({ ); -} \ No newline at end of file +} diff --git a/apps/web/app/login/page.tsx b/apps/web/app/login/page.tsx index b03fe796..6d6b338a 100644 --- a/apps/web/app/login/page.tsx +++ b/apps/web/app/login/page.tsx @@ -2,21 +2,21 @@ import LoginForm from "@/components/LoginForm"; import Link from "next/link"; export default function LoginPage() { - return ( -
-

Sign in

- -

- By signing in, you agree to our{" "} - - Terms - {" "} - and{" "} - - Privacy policy - - . -

-
- ); + return ( +
+

Sign in

+ +

+ By signing in, you agree to our{" "} + + Terms + {" "} + and{" "} + + Privacy policy + + . +

+
+ ); } diff --git a/apps/web/app/page.tsx b/apps/web/app/page.tsx index 9b62ce14..12bd0b1e 100644 --- a/apps/web/app/page.tsx +++ b/apps/web/app/page.tsx @@ -18,7 +18,7 @@ export default function Home() { Automatically generate thumbnails too!

- + diff --git a/apps/web/app/privacy/page.tsx b/apps/web/app/privacy/page.tsx index b2ff0b73..f83ff070 100644 --- a/apps/web/app/privacy/page.tsx +++ b/apps/web/app/privacy/page.tsx @@ -1,39 +1,43 @@ export default function Privacy() { return ( -
-

Privacy Policy

-

- This document explains what personal data we collect and how it is used. -

- -

1. Information we collect

-

- When you sign up for an account, we may collect your email address, your - name and your basic profile. -

- -

2. How your personal data is used

-

- We use your personal data to provide account related services like - associating data with the correct accounts. -

- -

- We may use your email to communicate with you regarding account related - services and changes to our terms, policies etc. -

- -

3. How we disclose personal data

-

We disclose your data only if it required to do so by law.

- -

4. Contact us

-

- If you have any questions related to our Privacy Policy, please send an - email to hi (at) codelit (dot) dev. -

- -

Updated: 10 Dec, 2023

-
+
+

Privacy Policy

+

+ This document explains what personal data we collect and how it + is used. +

+ +

1. Information we collect

+

+ When you sign up for an account, we may collect your email + address, your name and your basic profile. +

+ +

+ 2. How your personal data is used +

+

+ We use your personal data to provide account related services + like associating data with the correct accounts. +

+ +

+ We may use your email to communicate with you regarding account + related services and changes to our terms, policies etc. +

+ +

+ 3. How we disclose personal data +

+

We disclose your data only if it required to do so by law.

+ +

4. Contact us

+

+ If you have any questions related to our Privacy Policy, please + send an email to hi (at) codelit (dot) dev. +

+ +

Updated: 10 Dec, 2023

+
); - } - \ No newline at end of file +} diff --git a/apps/web/app/terms/page.tsx b/apps/web/app/terms/page.tsx index da3ec039..76713fcb 100644 --- a/apps/web/app/terms/page.tsx +++ b/apps/web/app/terms/page.tsx @@ -1,305 +1,328 @@ export default function Terms() { - return ( -
-

Terms and Conditions

-

Welcome to WebLit!

-

- These terms and conditions outline the rules and regulations for the use - of WebLit's Website, located at{" "} - https://weblit.pro. -

-

- By accessing this website we assume you accept these terms and - conditions. Do not continue to use WebLit if you do not agree to take - all of the terms and conditions stated on this page. -

-

- The following terminology applies to these Terms and Conditions, Privacy - Statement and Disclaimer Notice and all Agreements: "Client", - "You" and "Your" refers to you, the person log on - this website and compliant to the Company’s terms and conditions. - "The Company", "Ourselves", "We", - "Our" and "Us", refers to our Company. - "Party", "Parties", or "Us", refers to - both the Client and ourselves. All terms refer to the offer, acceptance - and consideration of payment necessary to undertake the process of our - assistance to the Client in the most appropriate manner for the express - purpose of meeting the Client’s needs in respect of provision of the - Company’s stated services, in accordance with and subject to, prevailing - law of Netherlands. Any use of the above terminology or other words in - the singular, plural, capitalization and/or he/she or they, are taken as - interchangeable and therefore as referring to same. -

- -

Cookies

-

- We employ the use of cookies. By accessing WebLit, you agreed to use - cookies in agreement with the WebLit's Privacy Policy.{" "} -

-

- Most interactive websites use cookies to let us retrieve the user’s - details for each visit. Cookies are used by our website to enable the - functionality of certain areas to make it easier for people visiting our - website. Some of our affiliate/advertising partners may also use - cookies. -

- -

License

- -

- Unless otherwise stated, WebLit and/or its licensors own the - intellectual property rights for all material on WebLit. All - intellectual property rights are reserved. You may access this from Web - Audit for your own personal use subjected to restrictions set in these - terms and conditions. -

- -

You must not:

- - -

- Parts of this website offer an opportunity for users to post and - exchange opinions and information in certain areas of the website. Web - Audit does not filter, edit, publish or review messages prior to their - presence on the website. Messages do not reflect the views and opinions - of WebLit,its agents and/or affiliates. Messages reflect the views and - opinions of the person who post their views and opinions. To the extent - permitted by applicable laws, WebLit shall not be liable for the - Messages or for any liability, damages or expenses caused and/or - suffered as a result of any use of and/or posting of and/or appearance - of the Messages on this website. -

- -

- WebLit reserves the right to monitor all Messages and to remove any - Messages which can be considered inappropriate, offensive or causes - breach of these Terms and Conditions. -

- -

You warrant and represent that:

- - - -

- You hereby grant WebLit a non-exclusive license to use, reproduce, edit - and authorize others to use, reproduce and edit any of your messages in - any and all forms, formats or media. -

- -

Hyperlinking to our Content

- -

- The following organizations may link to our Website without prior - written approval: -

- - - -

- These organizations may link to our home page, to publications or to - other Website information so long as the link: (a) is not in any way - deceptive; (b) does not falsely imply sponsorship, endorsement or - approval of the linking party and its products and/or services; and (c) - fits within the context of the linking party’s site. -

- -

- We may consider and approve other link requests from the following types - of organizations: -

- - - -

- We will approve link requests from these organizations if we decide - that: (a) the link would not make us look unfavorably to ourselves or to - our accredited businesses; (b) the organization does not have any - negative records with us; (c) the benefit to us from the visibility of - the hyperlink compensates the absence of WebLit; and (d) the link is in - the context of general resource information. -

- -

- These organizations may link to our home page so long as the link: (a) - is not in any way deceptive; (b) does not falsely imply sponsorship, - endorsement or approval of the linking party and its products or - services; and (c) fits within the context of the linking party’s site. -

- -

- If you are one of the organizations listed in paragraph 2 above and are - interested in linking to our website, you must inform us by sending an - e-mail to WebLit. Please include your name, your organization name, - contact information as well as the URL of your site, a list of any URLs - from which you intend to link to our Website, and a list of the URLs on - our site to which you would like to link. Wait 2-3 weeks for a response. -

- -

Approved organizations may hyperlink to our Website as follows:

- - - -

- No use of WebLit's logo or other artwork will be allowed for - linking absent a trademark license agreement. -

- -

iFrames

- -

- Without prior approval and written permission, you may not create frames - around our Webpages that alter in any way the visual presentation or - appearance of our Website. -

- -

Content Liability

- -

- We shall not be hold responsible for any content that appears on your - Website. You agree to protect and defend us against all claims that is - rising on your Website. No link(s) should appear on any Website that may - be interpreted as libelous, obscene or criminal, or which infringes, - otherwise violates, or advocates the infringement or other violation of, - any third party rights. -

- -

Your Privacy

- -

- Please read Privacy Policy -

- -

Reservation of Rights

- -

- We reserve the right to request that you remove all links or any - particular link to our Website. You approve to immediately remove all - links to our Website upon request. We also reserve the right to amen - these terms and conditions and it’s linking policy at any time. By - continuously linking to our Website, you agree to be bound to and follow - these linking terms and conditions. -

- -

Removal of links from our website

- -

- If you find any link on our Website that is offensive for any reason, - you are free to contact and inform us any moment. We will consider - requests to remove links but we are not obligated to or so or to respond - to you directly. -

- -

- We do not ensure that the information on this website is correct, we do - not warrant its completeness or accuracy; nor do we promise to ensure - that the website remains available or that the material on the website - is kept up to date. -

- -

Disclaimer

- -

- To the maximum extent permitted by applicable law, we exclude all - representations, warranties and conditions relating to our website and - the use of this website. Nothing in this disclaimer will: -

- - - -

- The limitations and prohibitions of liability set in this Section and - elsewhere in this disclaimer: (a) are subject to the preceding - paragraph; and (b) govern all liabilities arising under the disclaimer, - including liabilities arising in contract, in tort and for breach of - statutory duty. -

- -

- As long as the website and the information and services on the website - are provided free of charge, we will not be liable for any loss or - damage of any nature. -

-
- ); + return ( +
+

Terms and Conditions

+

Welcome to WebLit!

+

+ These terms and conditions outline the rules and regulations for + the use of WebLit's Website, located at{" "} + https://weblit.pro. +

+

+ By accessing this website we assume you accept these terms and + conditions. Do not continue to use WebLit if you do not agree to + take all of the terms and conditions stated on this page. +

+

+ The following terminology applies to these Terms and Conditions, + Privacy Statement and Disclaimer Notice and all Agreements: + "Client", "You" and "Your" refers + to you, the person log on this website and compliant to the + Company’s terms and conditions. "The Company", + "Ourselves", "We", "Our" and + "Us", refers to our Company. "Party", + "Parties", or "Us", refers to both the + Client and ourselves. All terms refer to the offer, acceptance + and consideration of payment necessary to undertake the process + of our assistance to the Client in the most appropriate manner + for the express purpose of meeting the Client’s needs in respect + of provision of the Company’s stated services, in accordance + with and subject to, prevailing law of Netherlands. Any use of + the above terminology or other words in the singular, plural, + capitalization and/or he/she or they, are taken as + interchangeable and therefore as referring to same. +

+ +

Cookies

+

+ We employ the use of cookies. By accessing WebLit, you agreed to + use cookies in agreement with the WebLit's Privacy Policy.{" "} +

+

+ Most interactive websites use cookies to let us retrieve the + user’s details for each visit. Cookies are used by our website + to enable the functionality of certain areas to make it easier + for people visiting our website. Some of our + affiliate/advertising partners may also use cookies. +

+ +

License

+ +

+ Unless otherwise stated, WebLit and/or its licensors own the + intellectual property rights for all material on WebLit. All + intellectual property rights are reserved. You may access this + from Web Audit for your own personal use subjected to + restrictions set in these terms and conditions. +

+ +

You must not:

+ + +

+ Parts of this website offer an opportunity for users to post and + exchange opinions and information in certain areas of the + website. Web Audit does not filter, edit, publish or review + messages prior to their presence on the website. Messages do not + reflect the views and opinions of WebLit,its agents and/or + affiliates. Messages reflect the views and opinions of the + person who post their views and opinions. To the extent + permitted by applicable laws, WebLit shall not be liable for the + Messages or for any liability, damages or expenses caused and/or + suffered as a result of any use of and/or posting of and/or + appearance of the Messages on this website. +

+ +

+ WebLit reserves the right to monitor all Messages and to remove + any Messages which can be considered inappropriate, offensive or + causes breach of these Terms and Conditions. +

+ +

You warrant and represent that:

+ + + +

+ You hereby grant WebLit a non-exclusive license to use, + reproduce, edit and authorize others to use, reproduce and edit + any of your messages in any and all forms, formats or media. +

+ +

Hyperlinking to our Content

+ +

+ The following organizations may link to our Website without + prior written approval: +

+ + + +

+ These organizations may link to our home page, to publications + or to other Website information so long as the link: (a) is not + in any way deceptive; (b) does not falsely imply sponsorship, + endorsement or approval of the linking party and its products + and/or services; and (c) fits within the context of the linking + party’s site. +

+ +

+ We may consider and approve other link requests from the + following types of organizations: +

+ + + +

+ We will approve link requests from these organizations if we + decide that: (a) the link would not make us look unfavorably to + ourselves or to our accredited businesses; (b) the organization + does not have any negative records with us; (c) the benefit to + us from the visibility of the hyperlink compensates the absence + of WebLit; and (d) the link is in the context of general + resource information. +

+ +

+ These organizations may link to our home page so long as the + link: (a) is not in any way deceptive; (b) does not falsely + imply sponsorship, endorsement or approval of the linking party + and its products or services; and (c) fits within the context of + the linking party’s site. +

+ +

+ If you are one of the organizations listed in paragraph 2 above + and are interested in linking to our website, you must inform us + by sending an e-mail to WebLit. Please include your name, your + organization name, contact information as well as the URL of + your site, a list of any URLs from which you intend to link to + our Website, and a list of the URLs on our site to which you + would like to link. Wait 2-3 weeks for a response. +

+ +

+ Approved organizations may hyperlink to our Website as follows: +

+ + + +

+ No use of WebLit's logo or other artwork will be allowed + for linking absent a trademark license agreement. +

+ +

iFrames

+ +

+ Without prior approval and written permission, you may not + create frames around our Webpages that alter in any way the + visual presentation or appearance of our Website. +

+ +

Content Liability

+ +

+ We shall not be hold responsible for any content that appears on + your Website. You agree to protect and defend us against all + claims that is rising on your Website. No link(s) should appear + on any Website that may be interpreted as libelous, obscene or + criminal, or which infringes, otherwise violates, or advocates + the infringement or other violation of, any third party rights. +

+ +

Your Privacy

+ +

+ Please read Privacy Policy +

+ +

Reservation of Rights

+ +

+ We reserve the right to request that you remove all links or any + particular link to our Website. You approve to immediately + remove all links to our Website upon request. We also reserve + the right to amen these terms and conditions and it’s linking + policy at any time. By continuously linking to our Website, you + agree to be bound to and follow these linking terms and + conditions. +

+ +

+ Removal of links from our website +

+ +

+ If you find any link on our Website that is offensive for any + reason, you are free to contact and inform us any moment. We + will consider requests to remove links but we are not obligated + to or so or to respond to you directly. +

+ +

+ We do not ensure that the information on this website is + correct, we do not warrant its completeness or accuracy; nor do + we promise to ensure that the website remains available or that + the material on the website is kept up to date. +

+ +

Disclaimer

+ +

+ To the maximum extent permitted by applicable law, we exclude + all representations, warranties and conditions relating to our + website and the use of this website. Nothing in this disclaimer + will: +

+ + + +

+ The limitations and prohibitions of liability set in this + Section and elsewhere in this disclaimer: (a) are subject to the + preceding paragraph; and (b) govern all liabilities arising + under the disclaimer, including liabilities arising in contract, + in tort and for breach of statutory duty. +

+ +

+ As long as the website and the information and services on the + website are provided free of charge, we will not be liable for + any loss or damage of any nature. +

+
+ ); } diff --git a/apps/web/components/Button.tsx b/apps/web/components/Button.tsx index 65836cab..5159e778 100644 --- a/apps/web/components/Button.tsx +++ b/apps/web/components/Button.tsx @@ -7,10 +7,17 @@ interface ButtonProps { disabled?: any; } -export default function Button({ children, onClick, className = "", disabled }: ButtonProps) { +export default function Button({ + children, + onClick, + className = "", + disabled, +}: ButtonProps) { return ( - diff --git a/apps/web/components/ui/avatar.tsx b/apps/web/components/ui/avatar.tsx index 51e507ba..8d1b7db7 100644 --- a/apps/web/components/ui/avatar.tsx +++ b/apps/web/components/ui/avatar.tsx @@ -1,50 +1,50 @@ -"use client" +"use client"; -import * as React from "react" -import * as AvatarPrimitive from "@radix-ui/react-avatar" +import * as React from "react"; +import * as AvatarPrimitive from "@radix-ui/react-avatar"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const Avatar = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - -)) -Avatar.displayName = AvatarPrimitive.Root.displayName + +)); +Avatar.displayName = AvatarPrimitive.Root.displayName; const AvatarImage = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - -)) -AvatarImage.displayName = AvatarPrimitive.Image.displayName + +)); +AvatarImage.displayName = AvatarPrimitive.Image.displayName; const AvatarFallback = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - -)) -AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName + +)); +AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName; -export { Avatar, AvatarImage, AvatarFallback } +export { Avatar, AvatarImage, AvatarFallback }; diff --git a/apps/web/components/ui/button.tsx b/apps/web/components/ui/button.tsx index 0ba42773..cd7d5b95 100644 --- a/apps/web/components/ui/button.tsx +++ b/apps/web/components/ui/button.tsx @@ -1,56 +1,57 @@ -import * as React from "react" -import { Slot } from "@radix-ui/react-slot" -import { cva, type VariantProps } from "class-variance-authority" +import * as React from "react"; +import { Slot } from "@radix-ui/react-slot"; +import { cva, type VariantProps } from "class-variance-authority"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const buttonVariants = cva( - "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", - { - variants: { - variant: { - default: "bg-primary text-primary-foreground hover:bg-primary/90", - destructive: - "bg-destructive text-destructive-foreground hover:bg-destructive/90", - outline: - "border border-input bg-background hover:bg-accent hover:text-accent-foreground", - secondary: - "bg-secondary text-secondary-foreground hover:bg-secondary/80", - ghost: "hover:bg-accent hover:text-accent-foreground", - link: "text-primary underline-offset-4 hover:underline", - }, - size: { - default: "h-10 px-4 py-2", - sm: "h-9 rounded-md px-3", - lg: "h-11 rounded-md px-8", - icon: "h-10 w-10", - }, - }, - defaultVariants: { - variant: "default", - size: "default", - }, - } -) + "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", + { + variants: { + variant: { + default: + "bg-primary text-primary-foreground hover:bg-primary/90", + destructive: + "bg-destructive text-destructive-foreground hover:bg-destructive/90", + outline: + "border border-input bg-background hover:bg-accent hover:text-accent-foreground", + secondary: + "bg-secondary text-secondary-foreground hover:bg-secondary/80", + ghost: "hover:bg-accent hover:text-accent-foreground", + link: "text-primary underline-offset-4 hover:underline", + }, + size: { + default: "h-10 px-4 py-2", + sm: "h-9 rounded-md px-3", + lg: "h-11 rounded-md px-8", + icon: "h-10 w-10", + }, + }, + defaultVariants: { + variant: "default", + size: "default", + }, + } +); export interface ButtonProps - extends React.ButtonHTMLAttributes, - VariantProps { - asChild?: boolean + extends React.ButtonHTMLAttributes, + VariantProps { + asChild?: boolean; } const Button = React.forwardRef( - ({ className, variant, size, asChild = false, ...props }, ref) => { - const Comp = asChild ? Slot : "button" - return ( - - ) - } -) -Button.displayName = "Button" + ({ className, variant, size, asChild = false, ...props }, ref) => { + const Comp = asChild ? Slot : "button"; + return ( + + ); + } +); +Button.displayName = "Button"; -export { Button, buttonVariants } +export { Button, buttonVariants }; diff --git a/apps/web/components/ui/dialog.tsx b/apps/web/components/ui/dialog.tsx index 01ff19c7..51abff26 100644 --- a/apps/web/components/ui/dialog.tsx +++ b/apps/web/components/ui/dialog.tsx @@ -1,122 +1,122 @@ -"use client" +"use client"; -import * as React from "react" -import * as DialogPrimitive from "@radix-ui/react-dialog" -import { X } from "lucide-react" +import * as React from "react"; +import * as DialogPrimitive from "@radix-ui/react-dialog"; +import { X } from "lucide-react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; -const Dialog = DialogPrimitive.Root +const Dialog = DialogPrimitive.Root; -const DialogTrigger = DialogPrimitive.Trigger +const DialogTrigger = DialogPrimitive.Trigger; -const DialogPortal = DialogPrimitive.Portal +const DialogPortal = DialogPrimitive.Portal; -const DialogClose = DialogPrimitive.Close +const DialogClose = DialogPrimitive.Close; const DialogOverlay = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - -)) -DialogOverlay.displayName = DialogPrimitive.Overlay.displayName + +)); +DialogOverlay.displayName = DialogPrimitive.Overlay.displayName; const DialogContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( - - - - {children} - - - Close - - - -)) -DialogContent.displayName = DialogPrimitive.Content.displayName + + + + {children} + + + Close + + + +)); +DialogContent.displayName = DialogPrimitive.Content.displayName; const DialogHeader = ({ - className, - ...props + className, + ...props }: React.HTMLAttributes) => ( -
-) -DialogHeader.displayName = "DialogHeader" +
+); +DialogHeader.displayName = "DialogHeader"; const DialogFooter = ({ - className, - ...props + className, + ...props }: React.HTMLAttributes) => ( -
-) -DialogFooter.displayName = "DialogFooter" +
+); +DialogFooter.displayName = "DialogFooter"; const DialogTitle = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - -)) -DialogTitle.displayName = DialogPrimitive.Title.displayName + +)); +DialogTitle.displayName = DialogPrimitive.Title.displayName; const DialogDescription = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - -)) -DialogDescription.displayName = DialogPrimitive.Description.displayName + +)); +DialogDescription.displayName = DialogPrimitive.Description.displayName; export { - Dialog, - DialogPortal, - DialogOverlay, - DialogClose, - DialogTrigger, - DialogContent, - DialogHeader, - DialogFooter, - DialogTitle, - DialogDescription, -} + Dialog, + DialogPortal, + DialogOverlay, + DialogClose, + DialogTrigger, + DialogContent, + DialogHeader, + DialogFooter, + DialogTitle, + DialogDescription, +}; diff --git a/apps/web/components/ui/dropdown-menu.tsx b/apps/web/components/ui/dropdown-menu.tsx index f69a0d64..29567db6 100644 --- a/apps/web/components/ui/dropdown-menu.tsx +++ b/apps/web/components/ui/dropdown-menu.tsx @@ -1,200 +1,203 @@ -"use client" +"use client"; -import * as React from "react" -import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu" -import { Check, ChevronRight, Circle } from "lucide-react" +import * as React from "react"; +import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu"; +import { Check, ChevronRight, Circle } from "lucide-react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; -const DropdownMenu = DropdownMenuPrimitive.Root +const DropdownMenu = DropdownMenuPrimitive.Root; -const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger +const DropdownMenuTrigger = DropdownMenuPrimitive.Trigger; -const DropdownMenuGroup = DropdownMenuPrimitive.Group +const DropdownMenuGroup = DropdownMenuPrimitive.Group; -const DropdownMenuPortal = DropdownMenuPrimitive.Portal +const DropdownMenuPortal = DropdownMenuPrimitive.Portal; -const DropdownMenuSub = DropdownMenuPrimitive.Sub +const DropdownMenuSub = DropdownMenuPrimitive.Sub; -const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup +const DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup; const DropdownMenuSubTrigger = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & { - inset?: boolean - } + React.ElementRef, + React.ComponentPropsWithoutRef & { + inset?: boolean; + } >(({ className, inset, children, ...props }, ref) => ( - - {children} - - -)) + + {children} + + +)); DropdownMenuSubTrigger.displayName = - DropdownMenuPrimitive.SubTrigger.displayName + DropdownMenuPrimitive.SubTrigger.displayName; const DropdownMenuSubContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - -)) + +)); DropdownMenuSubContent.displayName = - DropdownMenuPrimitive.SubContent.displayName + DropdownMenuPrimitive.SubContent.displayName; const DropdownMenuContent = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, sideOffset = 4, ...props }, ref) => ( - - - -)) -DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName + + + +)); +DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName; const DropdownMenuItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & { - inset?: boolean - } + React.ElementRef, + React.ComponentPropsWithoutRef & { + inset?: boolean; + } >(({ className, inset, ...props }, ref) => ( - -)) -DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName + +)); +DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName; const DropdownMenuCheckboxItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, children, checked, ...props }, ref) => ( - - - - - - - {children} - -)) + + + + + + + {children} + +)); DropdownMenuCheckboxItem.displayName = - DropdownMenuPrimitive.CheckboxItem.displayName + DropdownMenuPrimitive.CheckboxItem.displayName; const DropdownMenuRadioItem = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, children, ...props }, ref) => ( - - - - - - - {children} - -)) -DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName + + + + + + + {children} + +)); +DropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName; const DropdownMenuLabel = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & { - inset?: boolean - } + React.ElementRef, + React.ComponentPropsWithoutRef & { + inset?: boolean; + } >(({ className, inset, ...props }, ref) => ( - -)) -DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName + +)); +DropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName; const DropdownMenuSeparator = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - -)) -DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName + +)); +DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName; const DropdownMenuShortcut = ({ - className, - ...props + className, + ...props }: React.HTMLAttributes) => { - return ( - - ) -} -DropdownMenuShortcut.displayName = "DropdownMenuShortcut" + return ( + + ); +}; +DropdownMenuShortcut.displayName = "DropdownMenuShortcut"; export { - DropdownMenu, - DropdownMenuTrigger, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuCheckboxItem, - DropdownMenuRadioItem, - DropdownMenuLabel, - DropdownMenuSeparator, - DropdownMenuShortcut, - DropdownMenuGroup, - DropdownMenuPortal, - DropdownMenuSub, - DropdownMenuSubContent, - DropdownMenuSubTrigger, - DropdownMenuRadioGroup, -} + DropdownMenu, + DropdownMenuTrigger, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuCheckboxItem, + DropdownMenuRadioItem, + DropdownMenuLabel, + DropdownMenuSeparator, + DropdownMenuShortcut, + DropdownMenuGroup, + DropdownMenuPortal, + DropdownMenuSub, + DropdownMenuSubContent, + DropdownMenuSubTrigger, + DropdownMenuRadioGroup, +}; diff --git a/apps/web/components/ui/input.tsx b/apps/web/components/ui/input.tsx index 677d05fd..ab64cf3c 100644 --- a/apps/web/components/ui/input.tsx +++ b/apps/web/components/ui/input.tsx @@ -1,25 +1,25 @@ -import * as React from "react" +import * as React from "react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; export interface InputProps - extends React.InputHTMLAttributes {} + extends React.InputHTMLAttributes {} const Input = React.forwardRef( - ({ className, type, ...props }, ref) => { - return ( - - ) - } -) -Input.displayName = "Input" + ({ className, type, ...props }, ref) => { + return ( + + ); + } +); +Input.displayName = "Input"; -export { Input } +export { Input }; diff --git a/apps/web/components/ui/label.tsx b/apps/web/components/ui/label.tsx index 53418217..6ce7f61e 100644 --- a/apps/web/components/ui/label.tsx +++ b/apps/web/components/ui/label.tsx @@ -1,26 +1,26 @@ -"use client" +"use client"; -import * as React from "react" -import * as LabelPrimitive from "@radix-ui/react-label" -import { cva, type VariantProps } from "class-variance-authority" +import * as React from "react"; +import * as LabelPrimitive from "@radix-ui/react-label"; +import { cva, type VariantProps } from "class-variance-authority"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; const labelVariants = cva( - "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" -) + "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" +); const Label = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef & - VariantProps + React.ElementRef, + React.ComponentPropsWithoutRef & + VariantProps >(({ className, ...props }, ref) => ( - -)) -Label.displayName = LabelPrimitive.Root.displayName + +)); +Label.displayName = LabelPrimitive.Root.displayName; -export { Label } +export { Label }; diff --git a/apps/web/components/ui/sheet.tsx b/apps/web/components/ui/sheet.tsx index a37f17ba..5c0dcefe 100644 --- a/apps/web/components/ui/sheet.tsx +++ b/apps/web/components/ui/sheet.tsx @@ -1,140 +1,138 @@ -"use client" +"use client"; -import * as React from "react" -import * as SheetPrimitive from "@radix-ui/react-dialog" -import { cva, type VariantProps } from "class-variance-authority" -import { X } from "lucide-react" +import * as React from "react"; +import * as SheetPrimitive from "@radix-ui/react-dialog"; +import { cva, type VariantProps } from "class-variance-authority"; +import { X } from "lucide-react"; -import { cn } from "@/lib/utils" +import { cn } from "@/lib/utils"; -const Sheet = SheetPrimitive.Root +const Sheet = SheetPrimitive.Root; -const SheetTrigger = SheetPrimitive.Trigger +const SheetTrigger = SheetPrimitive.Trigger; -const SheetClose = SheetPrimitive.Close +const SheetClose = SheetPrimitive.Close; -const SheetPortal = SheetPrimitive.Portal +const SheetPortal = SheetPrimitive.Portal; const SheetOverlay = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - -)) -SheetOverlay.displayName = SheetPrimitive.Overlay.displayName + +)); +SheetOverlay.displayName = SheetPrimitive.Overlay.displayName; const sheetVariants = cva( - "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500", - { - variants: { - side: { - top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top", - bottom: - "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom", - left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm", - right: - "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm", - }, - }, - defaultVariants: { - side: "right", - }, - } -) + "fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500", + { + variants: { + side: { + top: "inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top", + bottom: "inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom", + left: "inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm", + right: "inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm", + }, + }, + defaultVariants: { + side: "right", + }, + } +); interface SheetContentProps - extends React.ComponentPropsWithoutRef, - VariantProps {} + extends React.ComponentPropsWithoutRef, + VariantProps {} const SheetContent = React.forwardRef< - React.ElementRef, - SheetContentProps + React.ElementRef, + SheetContentProps >(({ side = "right", className, children, ...props }, ref) => ( - - - - {children} - - - Close - - - -)) -SheetContent.displayName = SheetPrimitive.Content.displayName + + + + {children} + + + Close + + + +)); +SheetContent.displayName = SheetPrimitive.Content.displayName; const SheetHeader = ({ - className, - ...props + className, + ...props }: React.HTMLAttributes) => ( -
-) -SheetHeader.displayName = "SheetHeader" +
+); +SheetHeader.displayName = "SheetHeader"; const SheetFooter = ({ - className, - ...props + className, + ...props }: React.HTMLAttributes) => ( -
-) -SheetFooter.displayName = "SheetFooter" +
+); +SheetFooter.displayName = "SheetFooter"; const SheetTitle = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - -)) -SheetTitle.displayName = SheetPrimitive.Title.displayName + +)); +SheetTitle.displayName = SheetPrimitive.Title.displayName; const SheetDescription = React.forwardRef< - React.ElementRef, - React.ComponentPropsWithoutRef + React.ElementRef, + React.ComponentPropsWithoutRef >(({ className, ...props }, ref) => ( - -)) -SheetDescription.displayName = SheetPrimitive.Description.displayName + +)); +SheetDescription.displayName = SheetPrimitive.Description.displayName; export { - Sheet, - SheetPortal, - SheetOverlay, - SheetTrigger, - SheetClose, - SheetContent, - SheetHeader, - SheetFooter, - SheetTitle, - SheetDescription, -} + Sheet, + SheetPortal, + SheetOverlay, + SheetTrigger, + SheetClose, + SheetContent, + SheetHeader, + SheetFooter, + SheetTitle, + SheetDescription, +}; diff --git a/apps/web/components/ui/sonner.tsx b/apps/web/components/ui/sonner.tsx index 452f4d9f..d8dc1cc2 100644 --- a/apps/web/components/ui/sonner.tsx +++ b/apps/web/components/ui/sonner.tsx @@ -1,31 +1,30 @@ -"use client" +"use client"; -import { useTheme } from "next-themes" -import { Toaster as Sonner } from "sonner" +import { useTheme } from "next-themes"; +import { Toaster as Sonner } from "sonner"; -type ToasterProps = React.ComponentProps +type ToasterProps = React.ComponentProps; const Toaster = ({ ...props }: ToasterProps) => { - const { theme = "system" } = useTheme() + const { theme = "system" } = useTheme(); - return ( - - ) -} + return ( + + ); +}; -export { Toaster } +export { Toaster }; diff --git a/apps/web/components/ui/toaster.tsx b/apps/web/components/ui/toaster.tsx index e2233852..3391595e 100644 --- a/apps/web/components/ui/toaster.tsx +++ b/apps/web/components/ui/toaster.tsx @@ -1,35 +1,43 @@ -"use client" +"use client"; import { - Toast, - ToastClose, - ToastDescription, - ToastProvider, - ToastTitle, - ToastViewport, -} from "@/components/ui/toast" -import { useToast } from "@/components/ui/use-toast" + Toast, + ToastClose, + ToastDescription, + ToastProvider, + ToastTitle, + ToastViewport, +} from "@/components/ui/toast"; +import { useToast } from "@/components/ui/use-toast"; export function Toaster() { - const { toasts } = useToast() + const { toasts } = useToast(); - return ( - - {toasts.map(function ({ id, title, description, action, ...props }) { - return ( - -
- {title && {title}} - {description && ( - {description} - )} -
- {action} - -
- ) - })} - -
- ) + return ( + + {toasts.map(function ({ + id, + title, + description, + action, + ...props + }) { + return ( + +
+ {title && {title}} + {description && ( + + {description} + + )} +
+ {action} + +
+ ); + })} + +
+ ); } diff --git a/package.json b/package.json index cd51c928..0e0f5d81 100644 --- a/package.json +++ b/package.json @@ -13,10 +13,15 @@ }, "scripts": { "prepare": "husky install", - "ci:publish": "pnpm publish -r" + "ci:publish": "pnpm publish -r", + "test": "pnpm --filter=@medialit/api test", + "lint": "eslint --cache --quiet **/*.{ts,tsx}", + "prettier": "prettier --check **/*.{ts,tsx,js,css,md}", + "lint:fix": "eslint --cache --fix **/*.{ts,tsx}", + "prettier:fix": "prettier --write **/*.{ts,tsx,js,css,md}" }, "lint-staged": { - "*.ts": "eslint --cache --fix", - "*.{ts,js,css,md}": "prettier --write" + "*.{ts,tsx}": "eslint --cache --fix **/*.{ts,tsx}", + "*.{ts,tsx,js,css,md}": "prettier --write" } } diff --git a/packages/images/__tests__/images.test.js b/packages/images/__tests__/images.test.js index adc6b07a..e69de29b 100644 --- a/packages/images/__tests__/images.test.js +++ b/packages/images/__tests__/images.test.js @@ -1,7 +0,0 @@ -"use strict"; - -const images = require(".."); - -describe("@medialit/images", () => { - it("needs tests"); -}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 50c042f5..bb172f97 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -141,6 +141,9 @@ importers: ts-node: specifier: ^10.7.0 version: 10.9.1(@types/node@20.9.3)(typescript@5.3.2) + tsx: + specifier: ^4.7.0 + version: 4.7.0 typescript: specifier: ^5.2.2 version: 5.3.2 @@ -1370,6 +1373,213 @@ packages: '@jridgewell/trace-mapping': 0.3.9 dev: true + /@esbuild/aix-ppc64@0.19.12: + resolution: {integrity: sha512-bmoCYyWdEL3wDQIVbcyzRyeKLgk2WtWLTWz1ZIAZF/EGbNOwSA6ew3PftJ1PqMiOOGu0OyFMzG53L0zqIpPeNA==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [aix] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm64@0.19.12: + resolution: {integrity: sha512-P0UVNGIienjZv3f5zq0DP3Nt2IE/3plFzuaS96vihvD0Hd6H/q4WXUGpCxD/E8YrSXfNyRPbpTq+T8ZQioSuPA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-arm@0.19.12: + resolution: {integrity: sha512-qg/Lj1mu3CdQlDEEiWrlC4eaPZ1KztwGJ9B6J+/6G+/4ewxJg7gqj8eVYWvao1bXrqGiW2rsBZFSX3q2lcW05w==} + engines: {node: '>=12'} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/android-x64@0.19.12: + resolution: {integrity: sha512-3k7ZoUW6Q6YqhdhIaq/WZ7HwBpnFBlW905Fa4s4qWJyiNOgT1dOqDiVAQFwBH7gBRZr17gLrlFCRzF6jFh7Kew==} + engines: {node: '>=12'} + cpu: [x64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-arm64@0.19.12: + resolution: {integrity: sha512-B6IeSgZgtEzGC42jsI+YYu9Z3HKRxp8ZT3cqhvliEHovq8HSX2YX8lNocDn79gCKJXOSaEot9MVYky7AKjCs8g==} + engines: {node: '>=12'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/darwin-x64@0.19.12: + resolution: {integrity: sha512-hKoVkKzFiToTgn+41qGhsUJXFlIjxI/jSYeZf3ugemDYZldIXIxhvwN6erJGlX4t5h417iFuheZ7l+YVn05N3A==} + engines: {node: '>=12'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-arm64@0.19.12: + resolution: {integrity: sha512-4aRvFIXmwAcDBw9AueDQ2YnGmz5L6obe5kmPT8Vd+/+x/JMVKCgdcRwH6APrbpNXsPz+K653Qg8HB/oXvXVukA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/freebsd-x64@0.19.12: + resolution: {integrity: sha512-EYoXZ4d8xtBoVN7CEwWY2IN4ho76xjYXqSXMNccFSx2lgqOG/1TBPW0yPx1bJZk94qu3tX0fycJeeQsKovA8gg==} + engines: {node: '>=12'} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm64@0.19.12: + resolution: {integrity: sha512-EoTjyYyLuVPfdPLsGVVVC8a0p1BFFvtpQDB/YLEhaXyf/5bczaGeN15QkR+O4S5LeJ92Tqotve7i1jn35qwvdA==} + engines: {node: '>=12'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-arm@0.19.12: + resolution: {integrity: sha512-J5jPms//KhSNv+LO1S1TX1UWp1ucM6N6XuL6ITdKWElCu8wXP72l9MM0zDTzzeikVyqFE6U8YAV9/tFyj0ti+w==} + engines: {node: '>=12'} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ia32@0.19.12: + resolution: {integrity: sha512-Thsa42rrP1+UIGaWz47uydHSBOgTUnwBwNq59khgIwktK6x60Hivfbux9iNR0eHCHzOLjLMLfUMLCypBkZXMHA==} + engines: {node: '>=12'} + cpu: [ia32] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-loong64@0.19.12: + resolution: {integrity: sha512-LiXdXA0s3IqRRjm6rV6XaWATScKAXjI4R4LoDlvO7+yQqFdlr1Bax62sRwkVvRIrwXxvtYEHHI4dm50jAXkuAA==} + engines: {node: '>=12'} + cpu: [loong64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-mips64el@0.19.12: + resolution: {integrity: sha512-fEnAuj5VGTanfJ07ff0gOA6IPsvrVHLVb6Lyd1g2/ed67oU1eFzL0r9WL7ZzscD+/N6i3dWumGE1Un4f7Amf+w==} + engines: {node: '>=12'} + cpu: [mips64el] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-ppc64@0.19.12: + resolution: {integrity: sha512-nYJA2/QPimDQOh1rKWedNOe3Gfc8PabU7HT3iXWtNUbRzXS9+vgB0Fjaqr//XNbd82mCxHzik2qotuI89cfixg==} + engines: {node: '>=12'} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-riscv64@0.19.12: + resolution: {integrity: sha512-2MueBrlPQCw5dVJJpQdUYgeqIzDQgw3QtiAHUC4RBz9FXPrskyyU3VI1hw7C0BSKB9OduwSJ79FTCqtGMWqJHg==} + engines: {node: '>=12'} + cpu: [riscv64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-s390x@0.19.12: + resolution: {integrity: sha512-+Pil1Nv3Umes4m3AZKqA2anfhJiVmNCYkPchwFJNEJN5QxmTs1uzyy4TvmDrCRNT2ApwSari7ZIgrPeUx4UZDg==} + engines: {node: '>=12'} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/linux-x64@0.19.12: + resolution: {integrity: sha512-B71g1QpxfwBvNrfyJdVDexenDIt1CiDN1TIXLbhOw0KhJzE78KIFGX6OJ9MrtC0oOqMWf+0xop4qEU8JrJTwCg==} + engines: {node: '>=12'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@esbuild/netbsd-x64@0.19.12: + resolution: {integrity: sha512-3ltjQ7n1owJgFbuC61Oj++XhtzmymoCihNFgT84UAmJnxJfm4sYCiSLTXZtE00VWYpPMYc+ZQmB6xbSdVh0JWA==} + engines: {node: '>=12'} + cpu: [x64] + os: [netbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/openbsd-x64@0.19.12: + resolution: {integrity: sha512-RbrfTB9SWsr0kWmb9srfF+L933uMDdu9BIzdA7os2t0TXhCRjrQyCeOt6wVxr79CKD4c+p+YhCj31HBkYcXebw==} + engines: {node: '>=12'} + cpu: [x64] + os: [openbsd] + requiresBuild: true + dev: true + optional: true + + /@esbuild/sunos-x64@0.19.12: + resolution: {integrity: sha512-HKjJwRrW8uWtCQnQOz9qcU3mUZhTUQvi56Q8DPTLLB+DawoiQdjsYq+j+D3s9I8VFtDr+F9CjgXKKC4ss89IeA==} + engines: {node: '>=12'} + cpu: [x64] + os: [sunos] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-arm64@0.19.12: + resolution: {integrity: sha512-URgtR1dJnmGvX864pn1B2YUYNzjmXkuJOIqG2HdU62MVS4EHpU2946OZoTMnRUHklGtJdJZ33QfzdjGACXhn1A==} + engines: {node: '>=12'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-ia32@0.19.12: + resolution: {integrity: sha512-+ZOE6pUkMOJfmxmBZElNOx72NKpIa/HFOMGzu8fqzQJ5kgf6aTGrcJaFsNiVMH4JKpMipyK+7k0n2UXN7a8YKQ==} + engines: {node: '>=12'} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@esbuild/win32-x64@0.19.12: + resolution: {integrity: sha512-T1QyPSDCyMXaO3pzBkF96E8xMkiRYbUEZADd29SyPGabqxMViNoii+NcK7eWJAEoU6RZyEm5lVSIjTmcdoB9HA==} + engines: {node: '>=12'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@eslint-community/eslint-utils@4.4.0(eslint@8.54.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} @@ -4818,6 +5028,37 @@ packages: is-symbol: 1.0.4 dev: true + /esbuild@0.19.12: + resolution: {integrity: sha512-aARqgq8roFBj054KvQr5f1sFu0D65G+miZRCuJyJ0G13Zwx7vRar5Zhn2tkQNzIXcBrNVsv/8stehpj+GAjgbg==} + engines: {node: '>=12'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@esbuild/aix-ppc64': 0.19.12 + '@esbuild/android-arm': 0.19.12 + '@esbuild/android-arm64': 0.19.12 + '@esbuild/android-x64': 0.19.12 + '@esbuild/darwin-arm64': 0.19.12 + '@esbuild/darwin-x64': 0.19.12 + '@esbuild/freebsd-arm64': 0.19.12 + '@esbuild/freebsd-x64': 0.19.12 + '@esbuild/linux-arm': 0.19.12 + '@esbuild/linux-arm64': 0.19.12 + '@esbuild/linux-ia32': 0.19.12 + '@esbuild/linux-loong64': 0.19.12 + '@esbuild/linux-mips64el': 0.19.12 + '@esbuild/linux-ppc64': 0.19.12 + '@esbuild/linux-riscv64': 0.19.12 + '@esbuild/linux-s390x': 0.19.12 + '@esbuild/linux-x64': 0.19.12 + '@esbuild/netbsd-x64': 0.19.12 + '@esbuild/openbsd-x64': 0.19.12 + '@esbuild/sunos-x64': 0.19.12 + '@esbuild/win32-arm64': 0.19.12 + '@esbuild/win32-ia32': 0.19.12 + '@esbuild/win32-x64': 0.19.12 + dev: true + /escalade@3.1.1: resolution: {integrity: sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==} engines: {node: '>=6'} @@ -9740,6 +9981,17 @@ packages: typescript: 5.3.2 dev: true + /tsx@4.7.0: + resolution: {integrity: sha512-I+t79RYPlEYlHn9a+KzwrvEwhJg35h/1zHsLC2JXvhC2mdynMv6Zxzvhv5EMV6VF5qJlLlkSnMVvdZV3PSIGcg==} + engines: {node: '>=18.0.0'} + hasBin: true + dependencies: + esbuild: 0.19.12 + get-tsconfig: 4.7.2 + optionalDependencies: + fsevents: 2.3.3 + dev: true + /tty-table@4.2.3: resolution: {integrity: sha512-Fs15mu0vGzCrj8fmJNP7Ynxt5J7praPXqFN0leZeZBXJwkMxv9cb2D454k1ltrtUSJbZ4yH4e0CynsHLxmUfFA==} engines: {node: '>=8.0.0'}