From 66f10cd2f480c96d7e082ce55f9bb37e04acfc30 Mon Sep 17 00:00:00 2001 From: Miguel Romero Karam Date: Mon, 3 Jun 2024 15:26:13 +0200 Subject: [PATCH] chore: format codebase --- .github/ISSUE_TEMPLATE/bug_report.md | 3 +- .github/ISSUE_TEMPLATE/feature_request.md | 14 +- attributions.md | 12 +- code_of_conduct.md | 121 +++++++--------- contributing.md | 17 ++- lib/apis/create-api/auth/mod.ts | 7 +- lib/apis/create-api/mod.ts | 13 +- lib/apis/create-api/readme.md | 131 ++++++++---------- lib/apis/create-api/types.ts | 5 +- lib/apis/mongodbatlasdata.ts | 3 +- lib/cli/netzo.ts | 3 +- lib/cli/src/subcommands/deploy.ts | 7 +- lib/cli/src/subcommands/upgrade.ts | 9 +- lib/cli/src/utils/info.ts | 4 +- lib/cli/tests/help.test.ts | 6 +- lib/components/alert-dialog.tsx | 3 +- lib/components/badge.tsx | 14 +- lib/components/blocks/kanban/kanban.tsx | 16 +-- lib/components/blocks/netzo-toolbar.tsx | 3 +- lib/components/blocks/table/table-filters.tsx | 4 +- .../blocks/table/table-pagination.tsx | 24 +--- .../blocks/table/table-row-actions.tsx | 6 +- lib/components/blocks/table/table.tsx | 9 +- lib/components/button.tsx | 13 +- lib/components/calendar.tsx | 9 +- lib/components/card.tsx | 9 +- lib/components/carousel.tsx | 4 +- lib/components/combobox-virtualized.tsx | 18 +-- lib/components/combobox.tsx | 8 +- lib/components/context-menu.tsx | 3 +- lib/components/dropdown-menu.tsx | 9 +- lib/components/form-fields.tsx | 8 +- lib/components/form.tsx | 13 +- lib/components/input.tsx | 3 +- lib/components/nav-link.tsx | 4 +- lib/components/navigation-menu.tsx | 6 +- lib/components/pagination.tsx | 4 +- lib/components/select-multiple.tsx | 11 +- lib/components/select.tsx | 3 +- lib/components/sooner.tsx | 6 +- lib/components/table.tsx | 11 +- lib/components/textarea.tsx | 3 +- lib/components/toaster.tsx | 4 +- lib/components/use-toast.ts | 4 +- lib/datastore/signaldb.ts | 5 +- lib/deps/question/checkbox.ts | 41 ++---- lib/deps/question/confirm.ts | 15 +- lib/deps/question/list.ts | 27 ++-- lib/deps/question/mod.ts | 4 +- lib/deps/question/password.ts | 5 +- lib/deps/question/text-util.ts | 8 +- lib/deps/question/util.ts | 9 +- lib/plugins/auth/islands/auth-form.tsx | 10 +- lib/plugins/auth/middlewares/mod.ts | 3 +- lib/plugins/auth/plugin.ts | 6 +- lib/plugins/auth/routes/auth.tsx | 3 +- .../auth/utils/adapters/database.schema.ts | 12 +- lib/plugins/auth/utils/adapters/database.ts | 4 +- .../auth/utils/providers/netzo.sign_in.ts | 6 +- lib/plugins/database/plugin.ts | 2 +- lib/plugins/unocss/plugin.ts | 3 +- lib/plugins/unocss/preset-netzo.ts | 6 +- lib/plugins/unocss/preset-shadcn/mod.ts | 6 +- lib/plugins/utils.ts | 9 +- lib/readme.md | 52 +++---- readme.md | 52 +++---- tasks/lint_analysis.ipynb | 6 +- .../islands/InsertCssRules.tsx | 8 +- 68 files changed, 299 insertions(+), 590 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 8bc4a7ed8..9fa08a629 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -15,8 +15,7 @@ assignees: '' 3. Scroll down to '....' 4. See error -**Expected behavior** A clear and concise description of what you expected to -happen. +**Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 2866f790f..90320852b 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -6,14 +6,12 @@ labels: '' assignees: '' --- -**Is your feature request related to a problem? Please describe.** A clear and -concise description of what the problem is. Ex. I'm always frustrated when [...] +**Is your feature request related to a problem? Please describe.** A clear and concise description +of what the problem is. Ex. I'm always frustrated when [...] -**Describe the solution you'd like** A clear and concise description of what you -want to happen. +**Describe the solution you'd like** A clear and concise description of what you want to happen. -**Describe alternatives you've considered** A clear and concise description of -any alternative solutions or features you've considered. +**Describe alternatives you've considered** A clear and concise description of any alternative +solutions or features you've considered. -**Additional context** Add any other context or screenshots about the feature -request here. +**Additional context** Add any other context or screenshots about the feature request here. diff --git a/attributions.md b/attributions.md index 5fb0d4b6e..0c4b6280a 100644 --- a/attributions.md +++ b/attributions.md @@ -1,8 +1,8 @@ # Open Source License Attribution -This application uses Open Source components. You can find the source code of -their open source projects along with license information below. We acknowledge -and are grateful to these developers for their contributions to open source. +This application uses Open Source components. You can find the source code of their open source +projects along with license information below. We acknowledge and are grateful to these developers +for their contributions to open source. ### [deployctl](https://github.com/denoland/fresh) @@ -31,7 +31,5 @@ by [shadcn](https://github.com/shadcn-ui) is licensed under ### [@feathersjs/feathers](https://github.com/feathersjs/feathers) -by -[Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors) -is licensed under -[MIT License](https://github.com/feathersjs/feathers/blob/dove/LICENSE) +by [Feathers contributors](https://github.com/feathersjs/feathers/graphs/contributors) is licensed +under [MIT License](https://github.com/feathersjs/feathers/blob/dove/LICENSE) diff --git a/code_of_conduct.md b/code_of_conduct.md index dc6ef1e41..deca0d062 100644 --- a/code_of_conduct.md +++ b/code_of_conduct.md @@ -2,120 +2,105 @@ ## Our Pledge -We as members, contributors, and leaders pledge to make participation in our -community a harassment-free experience for everyone, regardless of age, body -size, visible or invisible disability, ethnicity, sex characteristics, gender -identity and expression, level of experience, education, socio-economic status, -nationality, personal appearance, race, caste, color, religion, or sexual -identity and orientation. +We as members, contributors, and leaders pledge to make participation in our community a +harassment-free experience for everyone, regardless of age, body size, visible or invisible +disability, ethnicity, sex characteristics, gender identity and expression, level of experience, +education, socio-economic status, nationality, personal appearance, race, caste, color, religion, or +sexual identity and orientation. -We pledge to act and interact in ways that contribute to an open, welcoming, -diverse, inclusive, and healthy community. +We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and +healthy community. ## Our Standards -Examples of behavior that contributes to a positive environment for our -community include: +Examples of behavior that contributes to a positive environment for our community include: - Demonstrating empathy and kindness toward other people - Being respectful of differing opinions, viewpoints, and experiences - Giving and gracefully accepting constructive feedback -- Accepting responsibility and apologizing to those affected by our mistakes, - and learning from the experience -- Focusing on what is best not just for us as individuals, but for the overall - community +- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the + experience +- Focusing on what is best not just for us as individuals, but for the overall community Examples of unacceptable behavior include: -- The use of sexualized language or imagery, and sexual attention or advances of - any kind +- 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 +- 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 ## Enforcement Responsibilities -Community leaders are responsible for clarifying and enforcing our standards of -acceptable behavior and will take appropriate and fair corrective action in -response to any behavior that they deem inappropriate, threatening, offensive, -or harmful. +Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior +and will take appropriate and fair corrective action in response to any behavior that they deem +inappropriate, threatening, offensive, or harmful. -Community leaders 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, and will communicate reasons for moderation -decisions when appropriate. +Community leaders 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, and +will communicate reasons for moderation decisions when appropriate. ## 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. +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. ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to the community leaders responsible for enforcement at -[help@netzo.io](mailto:help@netzo.io). All complaints will be reviewed and -investigated promptly and fairly. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community +leaders responsible for enforcement at [help@netzo.io](mailto:help@netzo.io). All complaints will be +reviewed and investigated promptly and fairly. -All community leaders are obligated to respect the privacy and security of the -reporter of any incident. +All community leaders are obligated to respect the privacy and security of the reporter of any +incident. ## Enforcement Guidelines -Community leaders will follow these Community Impact Guidelines in determining -the consequences for any action they deem in violation of this Code of Conduct: +Community leaders will follow these Community Impact Guidelines in determining the consequences for +any action they deem in violation of this Code of Conduct: ### 1. Correction -**Community Impact**: Use of inappropriate language or other behavior deemed -unprofessional or unwelcome in the community. +**Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or +unwelcome in the community. -**Consequence**: A private, written warning from community leaders, providing -clarity around the nature of the violation and an explanation of why the -behavior was inappropriate. A public apology may be requested. +**Consequence**: A private, written warning from community leaders, providing clarity around the +nature of the violation and an explanation of why the behavior was inappropriate. A public apology +may be requested. ### 2. Warning -**Community Impact**: A violation through a single incident or series of -actions. +**Community Impact**: A violation through a single incident or series of actions. -**Consequence**: A warning with consequences for continued behavior. No -interaction with the people involved, including unsolicited interaction with -those enforcing the Code of Conduct, for a specified period of time. This -includes avoiding interactions in community spaces as well as external channels -like social media. Violating these terms may lead to a temporary or permanent -ban. +**Consequence**: A warning with consequences for continued behavior. No interaction with the people +involved, including unsolicited interaction with those enforcing the Code of Conduct, for a +specified period of time. This includes avoiding interactions in community spaces as well as +external channels like social media. Violating these terms may lead to a temporary or permanent ban. ### 3. Temporary Ban -**Community Impact**: A serious violation of community standards, including -sustained inappropriate behavior. +**Community Impact**: A serious violation of community standards, including sustained inappropriate +behavior. -**Consequence**: A temporary ban from any sort of interaction or public -communication with the community for a specified period of time. No public or -private interaction with the people involved, including unsolicited interaction -with those enforcing the Code of Conduct, is allowed during this period. -Violating these terms may lead to a permanent ban. +**Consequence**: A temporary ban from any sort of interaction or public communication with the +community for a specified period of time. No public or private interaction with the people involved, +including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this +period. Violating these terms may lead to a permanent ban. ### 4. Permanent Ban -**Community Impact**: Demonstrating a pattern of violation of community -standards, including sustained inappropriate behavior, harassment of an -individual, or aggression toward or disparagement of classes of individuals. +**Community Impact**: Demonstrating a pattern of violation of community standards, including +sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement +of classes of individuals. -**Consequence**: A permanent ban from any sort of public interaction within the -community. +**Consequence**: A permanent ban from any sort of public interaction within the community. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], -version 2.1, available at +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.1, available at [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1]. Community Impact Guidelines were inspired by diff --git a/contributing.md b/contributing.md index cff966b58..2f0ad4e9d 100644 --- a/contributing.md +++ b/contributing.md @@ -1,25 +1,24 @@ # Contributing to Netzo Open Source -Thank you for your interest in contributing to Netzo Open Source! This document -is a set of guidelines to help you contribute to this project. +Thank you for your interest in contributing to Netzo Open Source! This document is a set of +guidelines to help you contribute to this project. ## Code of Conduct -By participating in this project, you are expected to uphold our -[Code of Conduct][code_of_conduct]. +By participating in this project, you are expected to uphold our [Code of Conduct][code_of_conduct]. [code_of_conduct]: https://opensource.creativecommons.org/community/code-of-conduct/ ## Project Documentation -The `README` in the root of the repository should contain or link to project -documentation. If you cannot find the documentation you're looking for, please -file a GitHub issue with details of what you'd like to see documented. +The `README` in the root of the repository should contain or link to project documentation. If you +cannot find the documentation you're looking for, please file a GitHub issue with details of what +you'd like to see documented. ## How to Contribute -Please follow the processes in our general [Contributing Code][contributing] -guidelines on the Creative Common Open Source website. +Please follow the processes in our general [Contributing Code][contributing] guidelines on the +Creative Common Open Source website. [contributing]: https://opensource.creativecommons.org/contributing-code/ diff --git a/lib/apis/create-api/auth/mod.ts b/lib/apis/create-api/auth/mod.ts index 0b9fed271..fd9ae78de 100644 --- a/lib/apis/create-api/auth/mod.ts +++ b/lib/apis/create-api/auth/mod.ts @@ -33,8 +33,7 @@ export const auth = async ( if (In === "query") query[name] = value; if (In === "header") headers[name] = value; } else if (authorization.type === "googlejwtsa") { - const { googleServiceAccountCredentials, googleAuthOptions } = - authorization; + const { googleServiceAccountCredentials, googleAuthOptions } = authorization; const { access_token }: GoogleAuth = await getTokenGoogleJwtSa( googleServiceAccountCredentials, googleAuthOptions, @@ -45,9 +44,7 @@ export const auth = async ( const { token_type = headerPrefix, access_token } = await getTokenOauth2( authorization, ); - headers.Authorization = token_type - ? `${token_type} ${access_token}` - : access_token; + headers.Authorization = token_type ? `${token_type} ${access_token}` : access_token; } options.query = { ...options.query, ...query }; diff --git a/lib/apis/create-api/mod.ts b/lib/apis/create-api/mod.ts index ea3bdb7ef..690582c66 100644 --- a/lib/apis/create-api/mod.ts +++ b/lib/apis/create-api/mod.ts @@ -1,15 +1,6 @@ import { $fetch, type FetchOptions } from "https://esm.sh/ofetch@1.1.1"; -import { - type QueryObject, - resolveURL, - withQuery, -} from "https://esm.sh/ufo@1.2.0"; -import type { - ApiClient, - ApiMethodHandler, - ApiMethodHandlerGET, - ResponseType, -} from "./types.ts"; +import { type QueryObject, resolveURL, withQuery } from "https://esm.sh/ufo@1.2.0"; +import type { ApiClient, ApiMethodHandler, ApiMethodHandlerGET, ResponseType } from "./types.ts"; import { headersToObject } from "./utils.ts"; const payloadMethods: ReadonlyArray = [ diff --git a/lib/apis/create-api/readme.md b/lib/apis/create-api/readme.md index 02b64e2d5..3d89f775d 100644 --- a/lib/apis/create-api/readme.md +++ b/lib/apis/create-api/readme.md @@ -1,8 +1,8 @@ # `create-api` -The `create-api` module exports the `createApi` factory function to create a -client for an HTTP API. The client is a minimal wrapper around the `fetch` API -using JS proxies that simplifies making HTTP requests. +The `create-api` module exports the `createApi` factory function to create a client for an HTTP API. +The client is a minimal wrapper around the `fetch` API using JS proxies that simplifies making HTTP +requests. ```ts const api = await createApi({ @@ -17,8 +17,8 @@ const user = await api.users[12].patch({ name: "John" }); ``` ::: tip This module is heavily inspired by -[`johannschopplich/unrested`](https://github.com/johannschopplich/unrested) and -its documentation. ::: +[`johannschopplich/unrested`](https://github.com/johannschopplich/unrested) and its documentation. +::: ## HTTP request methods @@ -32,21 +32,20 @@ Call the appropriate method call to make a request: ## Query parameters -For HTTP request methods supporting query parameters, add them to the method -call. +For HTTP request methods supporting query parameters, add them to the method call. ```ts // GET {baseURL}/users?search=john const result = await api.users.get({ search: "john" }); ``` -::: tip URL encoding Query parameters are automatically URL encoded using -`encodeURI`. You can pass the query parameters directly as an object. ::: +::: tip URL encoding Query parameters are automatically URL encoded using `encodeURI`. You can pass +the query parameters directly as an object. ::: ## Path parameters -To include dynamic API path segments, for example `GET` request to `/users/12`, -you have two options: +To include dynamic API path segments, for example `GET` request to `/users/12`, you have two +options: ```ts // GET {baseURL}/users/12 (chain syntax): @@ -82,8 +81,8 @@ const result = await api.users.get({ ## Authorization -The following table gives an overview of the currently supported auth types for -the [supported specs](#supported-specs): +The following table gives an overview of the currently supported auth types for the +[supported specs](#supported-specs): | **Auth Type** | **Support** | | ---------------------------- | :---------: | @@ -95,103 +94,89 @@ the [supported specs](#supported-specs): ### No auth -Requests will be sent without authorization by default. If your resource does -not require any authorization details you may go ahead and start using your -resource right away. +Requests will be sent without authorization by default. If your resource does not require any +authorization details you may go ahead and start using your resource right away. ### Basic auth -**Basic auth** schema is a simple authentication method built into the HTTP -protocol. The client must provide a user name and password when sending HTTP -requests. For this, the request contains a header field in the form of -`Authorization: Basic `, where credential is the Base64 encoding of -username and password joined together by a single colon. +**Basic auth** schema is a simple authentication method built into the HTTP protocol. The client +must provide a user name and password when sending HTTP requests. For this, the request contains a +header field in the form of `Authorization: Basic `, where credential is the Base64 +encoding of username and password joined together by a single colon. -To use this auth type select `HTTP` and `basic` options, and fill-out the -following required fields: +To use this auth type select `HTTP` and `basic` options, and fill-out the following required fields: - `username` - `password` ### Bearer auth -**Bearer auth** (also referred to as **token authentication**) schema is a -simple HTTP authentication schema that uses security tokens (referred to as -**bearer tokens**). Bearer tokens are text strings that are included in the -request header in the form of `Authorization: Bearer ` and act as access -keys. +**Bearer auth** (also referred to as **token authentication**) schema is a simple HTTP +authentication schema that uses security tokens (referred to as **bearer tokens**). Bearer tokens +are text strings that are included in the request header in the form of +`Authorization: Bearer ` and act as access keys. -To use this auth type select `HTTP` and `bearer` options, and fill-out the -following required fields: +To use this auth type select `HTTP` and `bearer` options, and fill-out the following required +fields: - `token` ### API key -**API keys** is a security schema that uses simple encrypted strings to identify -an application or project that is calling the API. API keys include a key-value -pair in the request headers or query parameters when sending requests to an API. -After selecting this security schema from the dropdown field, you must provide -the key-value pair before confirming to save your changes. +**API keys** is a security schema that uses simple encrypted strings to identify an application or +project that is calling the API. API keys include a key-value pair in the request headers or query +parameters when sending requests to an API. After selecting this security schema from the dropdown +field, you must provide the key-value pair before confirming to save your changes. -To use this auth type select `API Key`, select how to send the API key -(`header`, `query`, or `cookie`), and fill-out the following required fields: +To use this auth type select `API Key`, select how to send the API key (`header`, `query`, or +`cookie`), and fill-out the following required fields: - `name` - `value` -::: warning Multiple API Keys Some APIs use security key pairs (API key and App -ID) for authentication. For the time being we do not support multiple API Keys -out of the box. ::: +::: warning Multiple API Keys Some APIs use security key pairs (API key and App ID) for +authentication. For the time being we do not support multiple API Keys out of the box. ::: ### OAuth2 -:::warning Authorizing Resources via the OAuth2 protocol within Netzo is not yet -supported ::: +:::warning Authorizing Resources via the OAuth2 protocol within Netzo is not yet supported ::: -**OAuth2** is an authorization mechanism that gives API clients limited access -to user data on a web server. +**OAuth2** is an authorization mechanism that gives API clients limited access to user data on a web +server. -This authorization mechanism requires 3 pieces of information to generate an -**Access Token**: +This authorization mechanism requires 3 pieces of information to generate an **Access Token**: - **Client ID**: A unique identifier for the client application. -- **Client Secret**: A secret that is used to authenticate the client - application. -- **Authentication URL**: The URL that the client application uses to - authenticate with the server. +- **Client Secret**: A secret that is used to authenticate the client application. +- **Authentication URL**: The URL that the client application uses to authenticate with the server. You can use external services such as [Hopscotch](https://hoppscotch.io/) or [Postman](https://web.postman.co) to easily generate a token. The general steps are as follows -- (1) Add your resources **Client ID**, **Client Secret** and **Authorization - URL** within the authorization configuration -- (2) Look for a button to "Generate Token" or "Authorize", you will be prompted - to log into the account of your authentication provider -- (3) After successful generation, retrieve the `Token` contained in the - response -- (4) Set the **Access Token** as Bearer token in `header` or `query` parameters - within the Netzo resource authorization overlay. +- (1) Add your resources **Client ID**, **Client Secret** and **Authorization URL** within the + authorization configuration +- (2) Look for a button to "Generate Token" or "Authorize", you will be prompted to log into the + account of your authentication provider +- (3) After successful generation, retrieve the `Token` contained in the response +- (4) Set the **Access Token** as Bearer token in `header` or `query` parameters within the Netzo + resource authorization overlay. ## Hooks -**Hooks are async interceptors to hook into lifecycle events of the HTTP Request -and Response.** Hooks can be configured both for the base and for Requests. -**Base hooks** run before the corresponding **Request hook** rather than -overwriting them. This allows adding additional functionality at the Request -level, while retaining base functionality common to all Requests. +**Hooks are async interceptors to hook into lifecycle events of the HTTP Request and Response.** +Hooks can be configured both for the base and for Requests. **Base hooks** run before the +corresponding **Request hook** rather than overwriting them. This allows adding additional +functionality at the Request level, while retaining base functionality common to all Requests. There are four types of hooks: -- **`onRequest`:** runs **before** the `fetch` request is dispatched. Allows - modifying `request` and `options` -- **`onRequestError`:** runs **if** the `fetch` request fails. Allows modifying - `request`, `options` and `error` -- **`onResponse`:** runs **after** the `fetch` response returns (after - `response.body` is parsed and set to `response._data`). Allows modifying - `request`, `options` and `response` -- **`onResponseError`:** runs **if** the `fetch` response fails (when - `response.ok` is not true). Allows modifying `request`, `options` and - `response` +- **`onRequest`:** runs **before** the `fetch` request is dispatched. Allows modifying `request` and + `options` +- **`onRequestError`:** runs **if** the `fetch` request fails. Allows modifying `request`, `options` + and `error` +- **`onResponse`:** runs **after** the `fetch` response returns (after `response.body` is parsed and + set to `response._data`). Allows modifying `request`, `options` and `response` +- **`onResponseError`:** runs **if** the `fetch` response fails (when `response.ok` is not true). + Allows modifying `request`, `options` and `response` diff --git a/lib/apis/create-api/types.ts b/lib/apis/create-api/types.ts index b137af455..6a55fe508 100644 --- a/lib/apis/create-api/types.ts +++ b/lib/apis/create-api/types.ts @@ -11,8 +11,9 @@ export type ResponseMap = { }; export type ResponseType = keyof ResponseMap | "json"; -export type MappedType = R extends - keyof ResponseMap ? ResponseMap[R] : JsonType; +export type MappedType = R extends keyof ResponseMap + ? ResponseMap[R] + : JsonType; export type ApiMethodHandlerGET = < T = any, diff --git a/lib/apis/mongodbatlasdata.ts b/lib/apis/mongodbatlasdata.ts index 19c4d9c5e..fea127084 100644 --- a/lib/apis/mongodbatlasdata.ts +++ b/lib/apis/mongodbatlasdata.ts @@ -19,8 +19,7 @@ export const mongodbatlasdata = ({ apiKey = Deno.env.get("MONGODBATLASDATA_API_KEY")!, }: MongoDbAtlasDataOptions) => { const api = createApi({ - baseURL: - `https://data.mongodb-api.com/app/${dataApiAppId}/endpoint/data/v1`, + baseURL: `https://data.mongodb-api.com/app/${dataApiAppId}/endpoint/data/v1`, headers: { "content-type": "application/json", }, diff --git a/lib/cli/netzo.ts b/lib/cli/netzo.ts index 39855d3d4..c494b5d58 100644 --- a/lib/cli/netzo.ts +++ b/lib/cli/netzo.ts @@ -50,8 +50,7 @@ if (Deno.stdin.isTerminal()) { lastFetched: number; latest: number; }; - const moreThanADay = - Math.abs(Date.now() - updateInfo.lastFetched) > 24 * 60 * 60 * 1000; + const moreThanADay = Math.abs(Date.now() - updateInfo.lastFetched) > 24 * 60 * 60 * 1000; // Fetch the latest release if it has been more than a day since the last // time the information about new version is fetched. if (moreThanADay) { diff --git a/lib/cli/src/subcommands/deploy.ts b/lib/cli/src/subcommands/deploy.ts index f5f29d876..9dbbcc2ff 100644 --- a/lib/cli/src/subcommands/deploy.ts +++ b/lib/cli/src/subcommands/deploy.ts @@ -6,12 +6,7 @@ import type { Project, } from "../../../deps/@netzo/api/mod.ts"; import { exists } from "../../../deps/std/fs/exists.ts"; -import { - fromFileUrl, - globToRegExp, - isGlob, - normalize, -} from "../../../deps/std/path/mod.ts"; +import { fromFileUrl, globToRegExp, isGlob, normalize } from "../../../deps/std/path/mod.ts"; import { Spinner, wait } from "../../../deps/wait/mod.ts"; // vendored x/question@0.0.2 to silence deprecated API warnings (Deno>=1.4) import { netzo } from "../../../apis/netzo.ts"; diff --git a/lib/cli/src/subcommands/upgrade.ts b/lib/cli/src/subcommands/upgrade.ts index 1e98af35a..054238c83 100644 --- a/lib/cli/src/subcommands/upgrade.ts +++ b/lib/cli/src/subcommands/upgrade.ts @@ -1,14 +1,9 @@ -import { - isSemVer, - parse, - semverGreaterThanOrEquals, -} from "../../../deps/semver/mod.ts"; +import { isSemVer, parse, semverGreaterThanOrEquals } from "../../../deps/semver/mod.ts"; import { error } from "../../../plugins/utils.ts"; import type { Args as RawArgs } from "../args.ts"; import { VERSION } from "../version.ts"; -const help = - `netzo upgrade: upgrade netzo CLI to the given version (defaults to latest). +const help = `netzo upgrade: upgrade netzo CLI to the given version (defaults to latest). To upgrade to latest version: netzo upgrade diff --git a/lib/cli/src/utils/info.ts b/lib/cli/src/utils/info.ts index a9823cc00..c3961f713 100644 --- a/lib/cli/src/utils/info.ts +++ b/lib/cli/src/utils/info.ts @@ -2,9 +2,7 @@ import { join } from "../../../deps/std/path/mod.ts"; import { getVersions } from "../subcommands/upgrade.ts"; export function getConfigPaths() { - const homeDir = Deno.build.os == "windows" - ? Deno.env.get("USERPROFILE")! - : Deno.env.get("HOME")!; + const homeDir = Deno.build.os == "windows" ? Deno.env.get("USERPROFILE")! : Deno.env.get("HOME")!; const configDir = join(homeDir, ".deno", "netzo"); return { diff --git a/lib/cli/tests/help.test.ts b/lib/cli/tests/help.test.ts index 5bc0ddee4..7341fc165 100644 --- a/lib/cli/tests/help.test.ts +++ b/lib/cli/tests/help.test.ts @@ -1,8 +1,4 @@ -import { - assert, - assertEquals, - assertStringIncludes, -} from "../../deps/std/assert/mod.ts"; +import { assert, assertEquals, assertStringIncludes } from "../../deps/std/assert/mod.ts"; import { netzo, output } from "./utils.ts"; Deno.test("help command list", async () => { diff --git a/lib/components/alert-dialog.tsx b/lib/components/alert-dialog.tsx index e3e3753d2..ef4d631c8 100644 --- a/lib/components/alert-dialog.tsx +++ b/lib/components/alert-dialog.tsx @@ -94,8 +94,7 @@ const AlertDialogDescription = React.forwardRef< {...props} /> )); -AlertDialogDescription.displayName = - AlertDialogPrimitive.Description.displayName; +AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName; const AlertDialogAction = React.forwardRef< React.ElementRef, diff --git a/lib/components/badge.tsx b/lib/components/badge.tsx index d07891fdb..6ac3b9978 100644 --- a/lib/components/badge.tsx +++ b/lib/components/badge.tsx @@ -9,10 +9,8 @@ const badgeVariants = cva( { variants: { variant: { - default: - "border-transparent bg-primary text-primary-foreground shadow hover:bg-opacity-80", - secondary: - "border-transparent bg-secondary text-secondary-foreground hover:bg-opacity-80", + default: "border-transparent bg-primary text-primary-foreground shadow hover:bg-opacity-80", + secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-opacity-80", destructive: "border-transparent bg-destructive text-destructive-foreground shadow hover:bg-opacity-80", outline: "text-foreground", @@ -25,14 +23,10 @@ const badgeVariants = cva( ); export interface BadgeProps - extends - React.HTMLAttributes, - VariantProps {} + extends React.HTMLAttributes, VariantProps {} function Badge({ className, variant, ...props }: BadgeProps) { - return ( -
- ); + return
; } export { Badge, badgeVariants }; diff --git a/lib/components/blocks/kanban/kanban.tsx b/lib/components/blocks/kanban/kanban.tsx index 463dc595c..efa896df8 100644 --- a/lib/components/blocks/kanban/kanban.tsx +++ b/lib/components/blocks/kanban/kanban.tsx @@ -112,9 +112,7 @@ export function KanbanView({ itemId: UniqueIdentifier, groupIdValue: string, ) { - const itemsInGroup = data.filter((item) => - item[options.column] === groupIdValue - ); + const itemsInGroup = data.filter((item) => item[options.column] === groupIdValue); const itemPosition = itemsInGroup.findIndex((item) => item.id === itemId); const group = groups.value.find((col) => col.id === groupIdValue); return { @@ -128,9 +126,7 @@ export function KanbanView({ onDragStart({ active }) { if (!hasDraggableData(active)) return; if (active.data.current?.type === "Group") { - const startGroupIdx = groupsId.value.findIndex((id) => - id === active.id - ); + const startGroupIdx = groupsId.value.findIndex((id) => id === active.id); const startGroup = groups.value[startGroupIdx]; return `Picked up Group ${startGroup?.label} at position: ${ startGroupIdx + 1 @@ -187,9 +183,7 @@ export function KanbanView({ active.data.current?.type === "Group" && over.data.current?.type === "Group" ) { - const overGroupPosition = groupsId.value.findIndex((id) => - id === over.id - ); + const overGroupPosition = groupsId.value.findIndex((id) => id === over.id); return `Group ${active.data.current.group.label} was dropped into position ${ overGroupPosition + 1 @@ -304,9 +298,7 @@ export function KanbanView({ const isActiveAGroup = activeData?.type === "Group"; if (!isActiveAGroup) return; - const activeGroupIndex = groups.value.findIndex((col) => - col.id === activeId - ); + const activeGroupIndex = groups.value.findIndex((col) => col.id === activeId); const overGroupIndex = groups.value.findIndex((col) => col.id === overId); diff --git a/lib/components/blocks/netzo-toolbar.tsx b/lib/components/blocks/netzo-toolbar.tsx index 089f19bb3..2c2e858c6 100644 --- a/lib/components/blocks/netzo-toolbar.tsx +++ b/lib/components/blocks/netzo-toolbar.tsx @@ -20,8 +20,7 @@ export function NetzoToolbar({ className }: NetzoToolbarProps) { const expanded = useSignal(globalThis?.innerWidth >= 768); const styles = { - toolbarButton: - "text-zinc-100 rounded-full hover:bg-gray-600 hover:text-zinc-100", + toolbarButton: "text-zinc-100 rounded-full hover:bg-gray-600 hover:text-zinc-100", }; const onClickShare = () => { diff --git a/lib/components/blocks/table/table-filters.tsx b/lib/components/blocks/table/table-filters.tsx index 6eba4f981..a10745d3c 100644 --- a/lib/components/blocks/table/table-filters.tsx +++ b/lib/components/blocks/table/table-filters.tsx @@ -149,9 +149,7 @@ export function TableFilter({ : "opacity-50 mdi-checkbox-blank-outline", )} /> - {option.icon && ( - - )} + {option.icon && } {option.label} {facets?.get(option.value) && ( diff --git a/lib/components/blocks/table/table-pagination.tsx b/lib/components/blocks/table/table-pagination.tsx index cf8f2b695..09b10ae24 100644 --- a/lib/components/blocks/table/table-pagination.tsx +++ b/lib/components/blocks/table/table-pagination.tsx @@ -1,11 +1,5 @@ import { Button } from "../../button.tsx"; -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "../../select.tsx"; +import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../select.tsx"; import { cn } from "../../utils.ts"; import { useTablePagination } from "./hooks/use-table-pagination.ts"; import type { Table } from "./table.tsx"; @@ -112,18 +106,10 @@ export function TablePaginationButtons({ locale = "es", }: JSX.IntrinsicElements["div"] & Props) { const { pageIndex, pageSize, from, to, total } = useTablePagination(table); - const textFirst = locale === "en" - ? "Go to first page" - : "Ir a la primera página"; - const textPrevious = locale === "en" - ? "Go to previous page" - : "Ir a la página anterior"; - const textNext = locale === "en" - ? "Go to next page" - : "Ir a la página siguiente"; - const textLast = locale === "en" - ? "Go to last page" - : "Ir a la última página"; + const textFirst = locale === "en" ? "Go to first page" : "Ir a la primera página"; + const textPrevious = locale === "en" ? "Go to previous page" : "Ir a la página anterior"; + const textNext = locale === "en" ? "Go to next page" : "Ir a la página siguiente"; + const textLast = locale === "en" ? "Go to last page" : "Ir a la última página"; return (
(props: { children?: React.ReactNode }) { return ( diff --git a/lib/components/blocks/table/table.tsx b/lib/components/blocks/table/table.tsx index 92ffa922c..054fc171d 100644 --- a/lib/components/blocks/table/table.tsx +++ b/lib/components/blocks/table/table.tsx @@ -19,14 +19,7 @@ import { useReactTable, type VisibilityState, } from "../../../deps/@tanstack/react-table.ts"; -import { - Table, - TableBody, - TableCell, - TableHead, - TableHeader, - TableRow, -} from "../../table.tsx"; +import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../table.tsx"; import { cn } from "../../utils.ts"; import type { TableFilter } from "./table-filters.tsx"; import type { TableSearch } from "./table-search.tsx"; diff --git a/lib/components/button.tsx b/lib/components/button.tsx index e3033f0e4..d5b7a5f59 100644 --- a/lib/components/button.tsx +++ b/lib/components/button.tsx @@ -11,14 +11,11 @@ const buttonVariants = cva( { variants: { variant: { - default: - "bg-primary text-primary-foreground shadow hover:bg-opacity-90", - destructive: - "bg-destructive text-destructive-foreground shadow-sm hover:bg-opacity-90", + default: "bg-primary text-primary-foreground shadow hover:bg-opacity-90", + destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-opacity-90", outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground", - secondary: - "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary-80", + secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary-80", ghost: "bg-inherit hover:bg-accent hover:text-accent-foreground", link: "text-primary underline-offset-4 hover:underline", }, @@ -38,9 +35,7 @@ const buttonVariants = cva( ); export interface ButtonProps - extends - React.ButtonHTMLAttributes, - VariantProps { + extends React.ButtonHTMLAttributes, VariantProps { asChild?: boolean; } diff --git a/lib/components/calendar.tsx b/lib/components/calendar.tsx index 03747c7eb..eb27b09d2 100644 --- a/lib/components/calendar.tsx +++ b/lib/components/calendar.tsx @@ -31,8 +31,7 @@ function Calendar({ nav_button_next: "absolute right-1", table: "w-full border-collapse space-y-1", head_row: "flex", - head_cell: - "text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]", + head_cell: "text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]", row: "flex w-full mt-2", cell: cn( "relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent-50 [&:has([aria-selected].day-range-end)]:rounded-r-md", @@ -52,15 +51,13 @@ function Calendar({ day_outside: "day-outside text-muted-foreground opacity-50 aria-selected:bg-accent-50 aria-selected:text-muted-foreground aria-selected:opacity-30", day_disabled: "text-muted-foreground opacity-50", - day_range_middle: - "aria-selected:bg-accent aria-selected:text-accent-foreground", + day_range_middle: "aria-selected:bg-accent aria-selected:text-accent-foreground", day_hidden: "invisible", ...classNames, }} components={{ IconLeft: ({ ...props }) => , - IconRight: ({ ...props }) => - , + IconRight: ({ ...props }) => , }} {...props} /> diff --git a/lib/components/card.tsx b/lib/components/card.tsx index d9819508f..47f447e91 100644 --- a/lib/components/card.tsx +++ b/lib/components/card.tsx @@ -74,11 +74,4 @@ const CardFooter = React.forwardRef< )); CardFooter.displayName = "CardFooter"; -export { - Card, - CardContent, - CardDescription, - CardFooter, - CardHeader, - CardTitle, -}; +export { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle }; diff --git a/lib/components/carousel.tsx b/lib/components/carousel.tsx index 4be66dc14..a3936b10e 100644 --- a/lib/components/carousel.tsx +++ b/lib/components/carousel.tsx @@ -1,9 +1,7 @@ // @deno-types="npm:@types/react@18.2.60" import * as React from "react"; -import useEmblaCarousel, { - type UseEmblaCarouselType, -} from "../deps/embla-carousel-react.ts"; +import useEmblaCarousel, { type UseEmblaCarouselType } from "../deps/embla-carousel-react.ts"; import { Button } from "./button.tsx"; import { cn } from "./utils.ts"; diff --git a/lib/components/combobox-virtualized.tsx b/lib/components/combobox-virtualized.tsx index 317afae8a..9e9c2b51a 100644 --- a/lib/components/combobox-virtualized.tsx +++ b/lib/components/combobox-virtualized.tsx @@ -5,13 +5,7 @@ import * as React from "react"; import { useVirtualizer } from "../deps/@tanstack/react-virtual.ts"; import { useResizeObserver } from "../deps/usehooks-ts.ts"; import { Button } from "./button.tsx"; -import { - Command, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, -} from "./command.tsx"; +import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem } from "./command.tsx"; import { Popover, PopoverContent, PopoverTrigger } from "./popover.tsx"; import { cn } from "./utils.ts"; @@ -51,9 +45,7 @@ const VirtualizedCommand = ({ const handleSearch = (search: string) => { setFilteredOptions( - options.filter((option) => - option.label?.toLowerCase().includes(search?.toLowerCase() ?? "") - ), + options.filter((option) => option.label?.toLowerCase().includes(search?.toLowerCase() ?? "")), ); }; @@ -139,9 +131,7 @@ export function ComboboxVirtualized({ const ref = React.useRef(null); const { width = 0 } = useResizeObserver({ ref, box: "border-box" }); - const selectedOptionLabel = options.find(({ value }) => - value === selectedOption - )?.label; + const selectedOptionLabel = options.find(({ value }) => value === selectedOption)?.label; return ( @@ -174,7 +164,7 @@ export function ComboboxVirtualized({ let value = options.find(({ value }) => value === currentValue)?.value as string; if (!value) { value = options.find( - ({ value }) => value === currentValue.toLowerCase() + ({ value }) => value === currentValue.toLowerCase(), )?.value as string; } setSelectedOption(value); diff --git a/lib/components/combobox.tsx b/lib/components/combobox.tsx index 9f8215376..d5f921652 100644 --- a/lib/components/combobox.tsx +++ b/lib/components/combobox.tsx @@ -3,13 +3,7 @@ import * as React from "react"; import { Button } from "./button.tsx"; -import { - Command, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, -} from "./command.tsx"; +import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem } from "./command.tsx"; import { Popover, PopoverContent, PopoverTrigger } from "./popover.tsx"; import { ScrollArea } from "./scroll-area.tsx"; import { cn } from "./utils.ts"; diff --git a/lib/components/context-menu.tsx b/lib/components/context-menu.tsx index bc1bbb45e..2e30b1ef0 100644 --- a/lib/components/context-menu.tsx +++ b/lib/components/context-menu.tsx @@ -108,8 +108,7 @@ const ContextMenuCheckboxItem = React.forwardRef< {children} )); -ContextMenuCheckboxItem.displayName = - ContextMenuPrimitive.CheckboxItem.displayName; +ContextMenuCheckboxItem.displayName = ContextMenuPrimitive.CheckboxItem.displayName; const ContextMenuRadioItem = React.forwardRef< React.ElementRef, diff --git a/lib/components/dropdown-menu.tsx b/lib/components/dropdown-menu.tsx index 51ffa1510..0698d658d 100644 --- a/lib/components/dropdown-menu.tsx +++ b/lib/components/dropdown-menu.tsx @@ -35,8 +35,7 @@ const DropdownMenuSubTrigger = React.forwardRef< )); -DropdownMenuSubTrigger.displayName = - DropdownMenuPrimitive.SubTrigger.displayName; +DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName; const DropdownMenuSubContent = React.forwardRef< React.ElementRef, @@ -51,8 +50,7 @@ const DropdownMenuSubContent = React.forwardRef< {...props} /> )); -DropdownMenuSubContent.displayName = - DropdownMenuPrimitive.SubContent.displayName; +DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName; const DropdownMenuContent = React.forwardRef< React.ElementRef, @@ -112,8 +110,7 @@ const DropdownMenuCheckboxItem = React.forwardRef< {children} )); -DropdownMenuCheckboxItem.displayName = - DropdownMenuPrimitive.CheckboxItem.displayName; +DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName; const DropdownMenuRadioItem = React.forwardRef< React.ElementRef, diff --git a/lib/components/form-fields.tsx b/lib/components/form-fields.tsx index 3651c3cec..f85651e05 100644 --- a/lib/components/form-fields.tsx +++ b/lib/components/form-fields.tsx @@ -5,13 +5,7 @@ import { import { Checkbox } from "./checkbox.tsx"; import { Combobox, ComboboxProps } from "./combobox.tsx"; import type { UseFormReturn } from "./form.tsx"; -import { - FormControl, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "./form.tsx"; +import { FormControl, FormField, FormItem, FormLabel, FormMessage } from "./form.tsx"; import { Input, InputProps } from "./input.tsx"; import { RadioGroup, RadioGroupItem } from "./radio-group.tsx"; import { SelectMultiple, SelectMultipleProps } from "./select-multiple.tsx"; diff --git a/lib/components/form.tsx b/lib/components/form.tsx index da128168a..fa3f11ede 100644 --- a/lib/components/form.tsx +++ b/lib/components/form.tsx @@ -15,11 +15,7 @@ import { Label } from "./label.tsx"; import { cn } from "./utils.ts"; export { zodResolver } from "../deps/@hookform/resolvers/zod.ts"; -export { - useForm, - type UseFormProps, - type UseFormReturn, -} from "../deps/react-hook-form.ts"; +export { useForm, type UseFormProps, type UseFormReturn } from "../deps/react-hook-form.ts"; const Form = FormProvider; @@ -113,16 +109,13 @@ const FormControl = React.forwardRef< React.ElementRef, React.ComponentPropsWithoutRef >(({ ...props }, ref) => { - const { error, formItemId, formDescriptionId, formMessageId } = - useFormField(); + const { error, formItemId, formDescriptionId, formMessageId } = useFormField(); return ( diff --git a/lib/components/input.tsx b/lib/components/input.tsx index 6585a4564..d6429cb7b 100644 --- a/lib/components/input.tsx +++ b/lib/components/input.tsx @@ -5,8 +5,7 @@ import { IS_BROWSER } from "fresh/runtime.ts"; import { cn } from "./utils.ts"; // deno-lint-ignore no-empty-interface -export interface InputProps - extends React.InputHTMLAttributes {} +export interface InputProps extends React.InputHTMLAttributes {} const Input = React.forwardRef( ({ className, type, ...props }, ref) => { diff --git a/lib/components/nav-link.tsx b/lib/components/nav-link.tsx index e4fc82395..03fb77d96 100644 --- a/lib/components/nav-link.tsx +++ b/lib/components/nav-link.tsx @@ -10,9 +10,7 @@ import { buttonVariants } from "./button.tsx"; // Assuming Button.tsx is in the import { cn } from "./utils.ts"; export interface NavLinkProps - extends - Omit, "size">, - VariantProps { + extends Omit, "size">, VariantProps { asChild?: boolean; } diff --git a/lib/components/navigation-menu.tsx b/lib/components/navigation-menu.tsx index c6c42bc41..a6030c877 100644 --- a/lib/components/navigation-menu.tsx +++ b/lib/components/navigation-menu.tsx @@ -94,8 +94,7 @@ const NavigationMenuViewport = React.forwardRef< />
)); -NavigationMenuViewport.displayName = - NavigationMenuPrimitive.Viewport.displayName; +NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName; const NavigationMenuIndicator = React.forwardRef< React.ElementRef, @@ -112,8 +111,7 @@ const NavigationMenuIndicator = React.forwardRef<
)); -NavigationMenuIndicator.displayName = - NavigationMenuPrimitive.Indicator.displayName; +NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName; export { NavigationMenu, diff --git a/lib/components/pagination.tsx b/lib/components/pagination.tsx index 9b5494f3b..4bf35a5f2 100644 --- a/lib/components/pagination.tsx +++ b/lib/components/pagination.tsx @@ -29,9 +29,7 @@ PaginationContent.displayName = "PaginationContent"; const PaginationItem = React.forwardRef< HTMLLIElement, React.ComponentProps<"li"> ->(({ className, ...props }, ref) => ( -
  • -)); +>(({ className, ...props }, ref) =>
  • ); PaginationItem.displayName = "PaginationItem"; type PaginationLinkProps = diff --git a/lib/components/select-multiple.tsx b/lib/components/select-multiple.tsx index 341cfe884..2d63a6509 100644 --- a/lib/components/select-multiple.tsx +++ b/lib/components/select-multiple.tsx @@ -4,13 +4,7 @@ import * as React from "react"; import { Badge } from "./badge.tsx"; import { Button } from "./button.tsx"; -import { - Command, - CommandEmpty, - CommandGroup, - CommandInput, - CommandItem, -} from "./command.tsx"; +import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem } from "./command.tsx"; import { Popover, PopoverContent, PopoverTrigger } from "./popover.tsx"; import { cn } from "./utils.ts"; @@ -28,8 +22,7 @@ export type SelectMultipleProps = { }; function SelectMultiple( - { options, searchPlaceholder, value, onChange, className, ...props }: - SelectMultipleProps, + { options, searchPlaceholder, value, onChange, className, ...props }: SelectMultipleProps, ) { const [open, setOpen] = React.useState(false); diff --git a/lib/components/select.tsx b/lib/components/select.tsx index 98cd5b5ac..efa15a94c 100644 --- a/lib/components/select.tsx +++ b/lib/components/select.tsx @@ -62,8 +62,7 @@ const SelectScrollDownButton = React.forwardRef< )); -SelectScrollDownButton.displayName = - SelectPrimitive.ScrollDownButton.displayName; +SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName; const SelectContent = React.forwardRef< React.ElementRef, diff --git a/lib/components/sooner.tsx b/lib/components/sooner.tsx index 6a7300453..e5806cbab 100644 --- a/lib/components/sooner.tsx +++ b/lib/components/sooner.tsx @@ -20,10 +20,8 @@ const Toaster = ({ ...props }: ToasterProps) => { toast: "group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg", description: "group-[.toast]:text-muted-foreground", - actionButton: - "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground", - cancelButton: - "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground", + actionButton: "group-[.toast]:bg-primary group-[.toast]:text-primary-foreground", + cancelButton: "group-[.toast]:bg-muted group-[.toast]:text-muted-foreground", }, }} {...props} diff --git a/lib/components/table.tsx b/lib/components/table.tsx index de95654ba..29b283cf4 100644 --- a/lib/components/table.tsx +++ b/lib/components/table.tsx @@ -109,13 +109,4 @@ const TableCaption = React.forwardRef< )); TableCaption.displayName = "TableCaption"; -export { - Table, - TableBody, - TableCaption, - TableCell, - TableFooter, - TableHead, - TableHeader, - TableRow, -}; +export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow }; diff --git a/lib/components/textarea.tsx b/lib/components/textarea.tsx index a64496917..6abf03eed 100644 --- a/lib/components/textarea.tsx +++ b/lib/components/textarea.tsx @@ -5,8 +5,7 @@ import { IS_BROWSER } from "fresh/runtime.ts"; import { cn } from "./utils.ts"; // deno-lint-ignore no-empty-interface -export interface TextareaProps - extends React.TextareaHTMLAttributes {} +export interface TextareaProps extends React.TextareaHTMLAttributes {} const Textarea = React.forwardRef( ({ className, ...props }, ref) => { diff --git a/lib/components/toaster.tsx b/lib/components/toaster.tsx index 9802fc30a..015690271 100644 --- a/lib/components/toaster.tsx +++ b/lib/components/toaster.tsx @@ -21,9 +21,7 @@ export function Toaster() {
    {title && {title}} - {description && ( - {description} - )} + {description && {description}}
    {action} diff --git a/lib/components/use-toast.ts b/lib/components/use-toast.ts index 1fc10ed99..d1bb484af 100644 --- a/lib/components/use-toast.ts +++ b/lib/components/use-toast.ts @@ -79,9 +79,7 @@ export const reducer = (state: State, action: Action): State => { case "UPDATE_TOAST": return { ...state, - toasts: state.toasts.map((t) => - t.id === action.toast.id ? { ...t, ...action.toast } : t - ), + toasts: state.toasts.map((t) => t.id === action.toast.id ? { ...t, ...action.toast } : t), }; case "DISMISS_TOAST": { diff --git a/lib/datastore/signaldb.ts b/lib/datastore/signaldb.ts index 094e386f5..0abba76d1 100644 --- a/lib/datastore/signaldb.ts +++ b/lib/datastore/signaldb.ts @@ -1,8 +1,5 @@ import preactReactivityAdapter from "npm:signaldb-plugin-preact@1.0.1"; -import { - createPersistenceAdapter, - PersistentCollection, -} from "npm:signaldb@0.8.7"; +import { createPersistenceAdapter, PersistentCollection } from "npm:signaldb@0.8.7"; const createDatastoreAdapter = (name: string, data: any[]) => { let firstRender = true; diff --git a/lib/deps/question/checkbox.ts b/lib/deps/question/checkbox.ts index e037cfd38..b47847281 100644 --- a/lib/deps/question/checkbox.ts +++ b/lib/deps/question/checkbox.ts @@ -191,9 +191,7 @@ export default async function checkbox( const filteringOptions: TextFilteringOptions = Object.assign( {}, DEFAULT_TEXT_FILTERING, - typeof checkboxOptions?.filtering === "object" - ? checkboxOptions?.filtering ?? {} - : {}, + typeof checkboxOptions?.filtering === "object" ? checkboxOptions?.filtering ?? {} : {}, ); const filteringEnabled = checkboxOptions?.filtering === true || typeof checkboxOptions?.filtering === "object"; @@ -322,12 +320,8 @@ export default async function checkbox( (checkboxOptions?.offsetWindowScroll ?? true); if (offsetWindowScroll && cursorIndex !== 0) { - indexOffset = cursorIndex - 1 < indexOffset - ? cursorIndex - 1 - : indexOffset; - } else {indexOffset = cursorIndex < indexOffset - ? cursorIndex - : indexOffset;} + indexOffset = cursorIndex - 1 < indexOffset ? cursorIndex - 1 : indexOffset; + } else indexOffset = cursorIndex < indexOffset ? cursorIndex : indexOffset; await clear(); await prompt(); }], @@ -439,9 +433,7 @@ export default async function checkbox( }], [KeyCombos.parse("enter"), async ({ clear }) => { await clear(); - const result = selectedIds.map((id) => - possibleOptions.find((option) => option.id === id)! - ); + const result = selectedIds.map((id) => possibleOptions.find((option) => option.id === id)!); const text = result.length === 0 ? highlightText("") : result.map((item) => highlightText(item.display)).join(", "); @@ -517,8 +509,7 @@ export default async function checkbox( indexOffset = 0; if (searchText.trim() === "") return visibleOptions = possibleOptions; const results = textSearch(searchText, possibleOptions, { - transformer: (item) => - item.label + (item.tags.length ? "\t" + item.tags.join(" ") : ""), + transformer: (item) => item.label + (item.tags.length ? "\t" + item.tags.join(" ") : ""), matchCase: filteringOptions.matchCase, }); const intermediate = filteringOptions.sorting === "rank" @@ -531,9 +522,7 @@ export default async function checkbox( visibleOptions = finalList.map((result) => Object.assign({}, result.item, { - matchingTextRanges: result.matches.filter((it) => - it.start < result.item.label.length - ), + matchingTextRanges: result.matches.filter((it) => it.start < result.item.label.length), }) ); } @@ -617,23 +606,19 @@ function getOptionsFromObject( unparsedDeps.push(objectOption.dependencies); } else if ( Array.isArray(objectOption.dependencies) && - objectOption.dependencies.every((dep) => - ["string", "number"].includes(typeof dep) - ) + objectOption.dependencies.every((dep) => ["string", "number"].includes(typeof dep)) ) { unparsedDeps = objectOption.dependencies; } const deps = unparsedDeps .map((dep) => - typeof dep === "number" - ? (allEntries[dep]?.[1]?.id ?? allEntries[dep]?.[0]) - : (() => { - const item = allEntries.find(([l, oo], index) => - oo.id === dep || l === dep || String(index) === dep - ); - return item?.[1]?.id ?? item?.[0]; - })() + typeof dep === "number" ? (allEntries[dep]?.[1]?.id ?? allEntries[dep]?.[0]) : (() => { + const item = allEntries.find(([l, oo], index) => + oo.id === dep || l === dep || String(index) === dep + ); + return item?.[1]?.id ?? item?.[0]; + })() ) .filter((it) => it !== option.id && it !== undefined) .map((id) => String(id)); diff --git a/lib/deps/question/confirm.ts b/lib/deps/question/confirm.ts index 6e9072ec8..1465667a6 100644 --- a/lib/deps/question/confirm.ts +++ b/lib/deps/question/confirm.ts @@ -64,16 +64,11 @@ export default async function confirm( _positiveText.substring(1).toLowerCase(); const negativeText = _negativeText.substring(0, 1).toUpperCase() + _negativeText.substring(1).toLowerCase(); - const _defaultValue = - typeof defaultValue === "boolean" || typeof defaultValue === "undefined" - ? defaultValue - : defaultValue.defaultValue; - const positiveChar = _defaultValue === true - ? positiveText[0] - : positiveText[0].toLowerCase(); - const negativeChar = _defaultValue === false - ? negativeText[0] - : negativeText[0].toLowerCase(); + const _defaultValue = typeof defaultValue === "boolean" || typeof defaultValue === "undefined" + ? defaultValue + : defaultValue.defaultValue; + const positiveChar = _defaultValue === true ? positiveText[0] : positiveText[0].toLowerCase(); + const negativeChar = _defaultValue === false ? negativeText[0] : negativeText[0].toLowerCase(); const prompt = label + ` [${positiveChar}/${negativeChar}]`; let text = ""; return createRenderer({ diff --git a/lib/deps/question/list.ts b/lib/deps/question/list.ts index 21be2bd76..50de93154 100644 --- a/lib/deps/question/list.ts +++ b/lib/deps/question/list.ts @@ -198,9 +198,7 @@ export default async function list( const filteringOptions: TextFilteringOptions = Object.assign( {}, DEFAULT_TEXT_FILTERING, - typeof listOptions?.filtering === "object" - ? listOptions?.filtering ?? {} - : {}, + typeof listOptions?.filtering === "object" ? listOptions?.filtering ?? {} : {}, ); const inlineOptions: InlineOptions = Object.assign( {}, @@ -272,9 +270,7 @@ export default async function list( }/${possibleOptions.length}] Search: ${searchText}`; } const promptLineLength = 3 + label.length + - (!filteringEnabled - ? 0 - : 12 + ("" + possibleOptions.length).length * 2); + (!filteringEnabled ? 0 : 12 + ("" + possibleOptions.length).length * 2); out += "\n"; if (showNarrowWindow) { if (indexOffset !== 0) { @@ -306,9 +302,7 @@ export default async function list( }) + lineColor + after; } } - out += `${lineColor}${current} ${label}${RESET_COLOR}${ - index + 1 === len ? "" : "\n" - }`; + out += `${lineColor}${current} ${label}${RESET_COLOR}${index + 1 === len ? "" : "\n"}`; } if (showNarrowWindow) { @@ -349,12 +343,8 @@ export default async function list( (listOptions?.offsetWindowScroll ?? true); if (offsetWindowScroll && selectedIndex !== 0) { - indexOffset = selectedIndex - 1 < indexOffset - ? selectedIndex - 1 - : indexOffset; - } else {indexOffset = selectedIndex < indexOffset - ? selectedIndex - : indexOffset;} + indexOffset = selectedIndex - 1 < indexOffset ? selectedIndex - 1 : indexOffset; + } else indexOffset = selectedIndex < indexOffset ? selectedIndex : indexOffset; await clear(); await prompt(); }], @@ -378,10 +368,9 @@ export default async function list( indexOffset = selectedIndex >= indexOffset + actualWindowSize - 2 ? selectedIndex - actualWindowSize + 2 : indexOffset; - } else {indexOffset = - selectedIndex >= indexOffset + actualWindowSize - 1 - ? selectedIndex - actualWindowSize + 1 - : indexOffset;} + } else {indexOffset = selectedIndex >= indexOffset + actualWindowSize - 1 + ? selectedIndex - actualWindowSize + 1 + : indexOffset;} await clear(); await prompt(); }], diff --git a/lib/deps/question/mod.ts b/lib/deps/question/mod.ts index c8647bc4e..d8832a644 100644 --- a/lib/deps/question/mod.ts +++ b/lib/deps/question/mod.ts @@ -298,9 +298,7 @@ export function question( export { questionConfig }; -const [major, minor, _patch] = Deno.version.deno.split(".").map((it) => - parseInt(it) -); +const [major, minor, _patch] = Deno.version.deno.split(".").map((it) => parseInt(it)); export interface ConfigureForUnixPipesOptions { /** From where the input will be received. */ diff --git a/lib/deps/question/password.ts b/lib/deps/question/password.ts index fae4327b0..20d4299bf 100644 --- a/lib/deps/question/password.ts +++ b/lib/deps/question/password.ts @@ -50,9 +50,8 @@ export default async function password( clear: () => print(CLEAR_LINE), prompt: () => print( - PREFIX + asPromptText(prompt) + (sub.length === 0 - ? "" - : sub.repeat(Math.ceil(text.length / sub.length)).slice( + PREFIX + asPromptText(prompt) + + (sub.length === 0 ? "" : sub.repeat(Math.ceil(text.length / sub.length)).slice( 0, text.length, )) + diff --git a/lib/deps/question/text-util.ts b/lib/deps/question/text-util.ts index 6567087c9..e6f5175df 100644 --- a/lib/deps/question/text-util.ts +++ b/lib/deps/question/text-util.ts @@ -59,9 +59,7 @@ export function textSearch( let lastSequenceMatch = -1; for (let i = 0; i < searchTerms.length; i++) { if (lastSequenceMatch === -1) { - lastSequenceMatch = itemParts.findIndex((part) => - part === searchTerms[i] - ); + lastSequenceMatch = itemParts.findIndex((part) => part === searchTerms[i]); } else { if (itemParts[lastSequenceMatch + 1] === searchTerms[i]) { specificity.exactWordMatchesInSequence++; @@ -79,9 +77,7 @@ export function textSearch( lastSequenceMatch = -1; } } - const itemPartIndex = itemParts.findIndex((part) => - part === searchTerms[i] - ); + const itemPartIndex = itemParts.findIndex((part) => part === searchTerms[i]); if (itemPartIndex !== -1) { specificity.exactWordMatches++; const start = itemAsStringSearchable.indexOf( diff --git a/lib/deps/question/util.ts b/lib/deps/question/util.ts index faca86058..30cbf69b8 100644 --- a/lib/deps/question/util.ts +++ b/lib/deps/question/util.ts @@ -1,13 +1,8 @@ import KeyCombo, { KeyCombos } from "./KeyCombo.ts"; -import { - decodeKeypress, - Keypress, -} from "https://deno.land/x/keypress@0.0.7/mod.ts"; +import { decodeKeypress, Keypress } from "https://deno.land/x/keypress@0.0.7/mod.ts"; import { config as questionConfig } from "./config.ts"; -const [major, minor, _patch] = Deno.version.deno.split(".").map((it) => - parseInt(it) -); +const [major, minor, _patch] = Deno.version.deno.split(".").map((it) => parseInt(it)); export const PRIMARY_COLOR = "\x1b[94m"; export const RESET_COLOR = "\x1b[0m"; diff --git a/lib/plugins/auth/islands/auth-form.tsx b/lib/plugins/auth/islands/auth-form.tsx index bd4a113fb..193251c3e 100644 --- a/lib/plugins/auth/islands/auth-form.tsx +++ b/lib/plugins/auth/islands/auth-form.tsx @@ -1,9 +1,5 @@ import type { JSX } from "preact"; -import { - Alert, - AlertDescription, - AlertTitle, -} from "../../../components/alert.tsx"; +import { Alert, AlertDescription, AlertTitle } from "../../../components/alert.tsx"; import { Button, buttonVariants } from "../../../components/button.tsx"; import { Input } from "../../../components/input.tsx"; import { Label } from "../../../components/label.tsx"; @@ -43,9 +39,7 @@ export function AuthForm(props: AuthFormProps) { return ( <>
    - {logo && ( - Logo - )} + {logo && Logo} {title && (

    {title} diff --git a/lib/plugins/auth/middlewares/mod.ts b/lib/plugins/auth/middlewares/mod.ts index a61b78c81..8f93f14d0 100644 --- a/lib/plugins/auth/middlewares/mod.ts +++ b/lib/plugins/auth/middlewares/mod.ts @@ -127,8 +127,7 @@ export async function setRequestState( const referer = req.headers.get("referer")!; // SOMETIMES SET e.g. https://app.netzo.io/some-path // simple heuristics to determine source of request: - const assertIsApp = (url: string) => - !!url && new URL(url).host.endsWith("netzo.io"); + const assertIsApp = (url: string) => !!url && new URL(url).host.endsWith("netzo.io"); const isApp = assertIsApp(origin!) || assertIsApp(referer!); ctx.state.auth = { ...ctx.state.auth, origin, referer, isApp }; diff --git a/lib/plugins/auth/plugin.ts b/lib/plugins/auth/plugin.ts index 95c7832a5..21dbb9f9f 100644 --- a/lib/plugins/auth/plugin.ts +++ b/lib/plugins/auth/plugin.ts @@ -2,11 +2,11 @@ import type { FreshContext, Plugin, PluginRoute } from "$fresh/server.ts"; import { HTMLAttributes } from "preact/compat"; import type { NetzoState } from "../../mod.ts"; import { - NetzoStateWithAuth, assertUserIsMemberOfWorkspaceOfApiKeyIfProviderIsNetzo, createAssertUserIsAuthorized, createAuthState, ensureSignedIn, + NetzoStateWithAuth, setRequestState, setSessionState, } from "./middlewares/mod.ts"; @@ -138,9 +138,7 @@ export const auth = (config: AuthConfig): Plugin => { { path: "/auth", component: createAuth(config) }, ...Object.keys(config.providers) .filter((provider) => !!config?.providers?.[provider as AuthProvider]) - .flatMap((provider) => - getRoutesByProvider(provider as AuthProvider, config) - ), + .flatMap((provider) => getRoutesByProvider(provider as AuthProvider, config)), ]; return { diff --git a/lib/plugins/auth/routes/auth.tsx b/lib/plugins/auth/routes/auth.tsx index 88b6e69b0..f495009d8 100644 --- a/lib/plugins/auth/routes/auth.tsx +++ b/lib/plugins/auth/routes/auth.tsx @@ -14,8 +14,7 @@ export const config: RouteConfig = { export default (config: AuthConfig) => { return defineRoute((req, ctx) => { - const authFormWrapper = - "grid gap-6 w-full xs:w-[350px] max-w-[350px] pb-16"; + const authFormWrapper = "grid gap-6 w-full xs:w-[350px] max-w-[350px] pb-16"; if (config.image) { return (
    diff --git a/lib/plugins/auth/utils/adapters/database.schema.ts b/lib/plugins/auth/utils/adapters/database.schema.ts index 5c5523598..03470fd8b 100644 --- a/lib/plugins/auth/utils/adapters/database.schema.ts +++ b/lib/plugins/auth/utils/adapters/database.schema.ts @@ -15,12 +15,10 @@ export const $users = sqliteTable("$users", { email: text("email"), avatar: text("avatar"), data: text("data", { mode: "json" }).$default(() => ({})), - createdAt: text("createdAt").notNull().$default(() => + createdAt: text("createdAt").notNull().$default(() => new Date().toISOString()), + updatedAt: text("updatedAt").notNull().$default(() => new Date().toISOString()).$onUpdate(() => new Date().toISOString() ), - updatedAt: text("updatedAt").notNull().$default(() => - new Date().toISOString() - ).$onUpdate(() => new Date().toISOString()), deletedAt: text("deletedAt"), }); @@ -31,10 +29,8 @@ export type $UserData = typeof $users.$inferInsert; export const $sessions = sqliteTable("$sessions", { id: text("id").primaryKey().$default(() => id()), - $userId: text("$userId").notNull().references(() => $users.id, {onDelete: 'cascade'}), - createdAt: text("createdAt").notNull().$default(() => - new Date().toISOString() - ), + $userId: text("$userId").notNull().references(() => $users.id, { onDelete: "cascade" }), + createdAt: text("createdAt").notNull().$default(() => new Date().toISOString()), }); export type $Session = typeof $sessions.$inferSelect; diff --git a/lib/plugins/auth/utils/adapters/database.ts b/lib/plugins/auth/utils/adapters/database.ts index ea4f25d6e..894713924 100644 --- a/lib/plugins/auth/utils/adapters/database.ts +++ b/lib/plugins/auth/utils/adapters/database.ts @@ -24,8 +24,8 @@ export const createDatabaseAuth = (db: ReturnType): Auth => { await db.query.$users.findFirst({ where: eq($users.id, user.id) }); }, updateUserSession: async (user: AuthUser, sessionId: string) => { - // IMPORTANT: this invalidates the old session and creates a new one. - // If multiple sessions per user are allowed, this should be adjusted. + // IMPORTANT: this invalidates the old session and creates a new one. + // If multiple sessions per user are allowed, this should be adjusted. await db.transaction(async (tx) => { await tx.delete($sessions).where(eq($sessions.$userId, user.id)); await tx.insert($sessions).values({ id: sessionId, $userId: user.id }); diff --git a/lib/plugins/auth/utils/providers/netzo.sign_in.ts b/lib/plugins/auth/utils/providers/netzo.sign_in.ts index bb800626c..32e264de0 100644 --- a/lib/plugins/auth/utils/providers/netzo.sign_in.ts +++ b/lib/plugins/auth/utils/providers/netzo.sign_in.ts @@ -1,9 +1,5 @@ // adapted from https://github.com/denoland/deno_kv_oauth/blob/main/lib/sign_in.ts -import { - Cookie, - SECOND, - setCookie, -} from "../../../../deps/deno_kv_oauth/deps.ts"; +import { Cookie, SECOND, setCookie } from "../../../../deps/deno_kv_oauth/deps.ts"; import { COOKIE_BASE, getCookieName, diff --git a/lib/plugins/database/plugin.ts b/lib/plugins/database/plugin.ts index 15c6b96b0..d8144f4ca 100644 --- a/lib/plugins/database/plugin.ts +++ b/lib/plugins/database/plugin.ts @@ -1,7 +1,7 @@ // deno-lint-ignore-file no-explicit-any import type { Plugin, PluginRoute } from "fresh/server.ts"; import { createClient } from "npm:@libsql/client@0.6.0"; -import { SQL, eq, getTableColumns, sql } from "npm:drizzle-orm@0.30.10"; +import { eq, getTableColumns, SQL, sql } from "npm:drizzle-orm@0.30.10"; import { SQLiteTable } from "npm:drizzle-orm@0.30.10/sqlite-core"; import { DrizzleConfig } from "npm:drizzle-orm@0.30.10/utils"; import { database as createDatabase } from "../../database/mod.ts"; diff --git a/lib/plugins/unocss/plugin.ts b/lib/plugins/unocss/plugin.ts index fb4991fe4..736a40d66 100644 --- a/lib/plugins/unocss/plugin.ts +++ b/lib/plugins/unocss/plugin.ts @@ -232,8 +232,7 @@ export const unocss = ({ middlewares.push({ path: "/", middleware: { - handler: (_req, ctx) => - ctx.url.pathname === "/uno.css" ? resp : ctx.next(), + handler: (_req, ctx) => ctx.url.pathname === "/uno.css" ? resp : ctx.next(), }, }); } diff --git a/lib/plugins/unocss/preset-netzo.ts b/lib/plugins/unocss/preset-netzo.ts index 79087b3d1..0ff0ba97c 100644 --- a/lib/plugins/unocss/preset-netzo.ts +++ b/lib/plugins/unocss/preset-netzo.ts @@ -1,11 +1,7 @@ import { /*mergeDeep*/ type PresetOrFactory } from "../../deps/@unocss/core.ts"; import { presetIcons } from "../../deps/@unocss/preset-icons/browser.ts"; import { presetTypography } from "../../deps/@unocss/preset-typography.ts"; -import { - presetUno, - type PresetUnoOptions, - type Theme, -} from "../../deps/@unocss/preset-uno.ts"; +import { presetUno, type PresetUnoOptions, type Theme } from "../../deps/@unocss/preset-uno.ts"; import { presetShadcn } from "./preset-shadcn/mod.ts"; import type { PresetShadcnOptions } from "./preset-shadcn/types.ts"; diff --git a/lib/plugins/unocss/preset-shadcn/mod.ts b/lib/plugins/unocss/preset-shadcn/mod.ts index 129ef478a..d97f10196 100644 --- a/lib/plugins/unocss/preset-shadcn/mod.ts +++ b/lib/plugins/unocss/preset-shadcn/mod.ts @@ -1,9 +1,5 @@ // from https://github.com/hyoban/unocss-preset-shadcn -import type { - Preset, - VariantContext, - VariantObject, -} from "../../../deps/@unocss/core.ts"; +import type { Preset, VariantContext, VariantObject } from "../../../deps/@unocss/core.ts"; import { h, type Theme } from "../../../deps/@unocss/preset-mini.ts"; import { variantGetParameter } from "../../../deps/@unocss/utils.ts"; import { generateCSSVars } from "./generate.ts"; diff --git a/lib/plugins/utils.ts b/lib/plugins/utils.ts index 552ff7009..abe7fa773 100644 --- a/lib/plugins/utils.ts +++ b/lib/plugins/utils.ts @@ -1,11 +1,4 @@ -import { - blue, - bold, - green, - red, - white, - yellow, -} from "https://deno.land/std@0.208.0/fmt/colors.ts"; +import { blue, bold, green, red, white, yellow } from "https://deno.land/std@0.208.0/fmt/colors.ts"; import type { Project } from "./types.ts"; /** diff --git a/lib/readme.md b/lib/readme.md index c7cc51daf..0af30c800 100644 --- a/lib/readme.md +++ b/lib/readme.md @@ -9,8 +9,7 @@ Productive open-source framework for building business web apps. [Website](https://netzo.io) · [Docs](https://netzo.io/docs) · -[Issues](https://github.com/netzo/netzo/issues) · -[Discord](https://discord.gg/tbDUpRQCTk) +[Issues](https://github.com/netzo/netzo/issues) · [Discord](https://discord.gg/tbDUpRQCTk) --- @@ -22,43 +21,37 @@ Productive open-source framework for building business web apps.
    -> **We are on our [road to v1](https://netzo.io/roadmap/)! Be sure to pin -> version via `netzo@X.Y.Z` to ensure things don't break.** +> **We are on our [road to v1](https://netzo.io/roadmap/)! Be sure to pin version via `netzo@X.Y.Z` +> to ensure things don't break.** ## What is Netzo? -Netzo is a platform and batteries-included meta-framework for Deno Fresh. It -offers a collection of modules and opinionated best practices, empowering -developers to build web apps faster without sacrificing flexibility. +Netzo is a platform and batteries-included meta-framework for Deno Fresh. It offers a collection of +modules and opinionated best practices, empowering developers to build web apps faster without +sacrificing flexibility. - **Platform:** a cloud platform to deploy, manage, and scale your apps. -- **Framework:** built on **Deno Fresh**, a next-gen web framework designed for - rapid development. +- **Framework:** built on **Deno Fresh**, a next-gen web framework designed for rapid development. ## Why Netzo? > "Low-code tools make the first 60% easy, and the remaining 40% impossible." -Custom business app development has challenges. Traditional development is -complex and time-consuming. In business software not only is flexibility but -speed and efficiency are paramount. Our goal is to provide full-code flexibility -at no-code speeds boosting developer productivity and enabling them to build -apps 10x faster. +Custom business app development has challenges. Traditional development is complex and +time-consuming. In business software not only is flexibility but speed and efficiency are paramount. +Our goal is to provide full-code flexibility at no-code speeds boosting developer productivity and +enabling them to build apps 10x faster. ## Main Features -- **Authentication:** built-in user management and role-based access control - (RBAC). -- **Database:** built-in **Deno KV** database, a fast, reliable, and secure - key-value database. -- **Components:** beautifully designed, accessible, and customizable components - based on [`shadcn/ui`](https://ui.shadcn.com/) -- **Integrations:** a growing list of plug-and-play integrations for popular - APIs and Databases. -- **CSS/Styling:** built-in, pre-defined themes powered by **UnoCSS**, an - instant, on-demand atomic CSS engine. -- **CLI:** command-line interface (CLI) to help you develop and deploy Netzo - applications. +- **Authentication:** built-in user management and role-based access control (RBAC). +- **Database:** built-in **Deno KV** database, a fast, reliable, and secure key-value database. +- **Components:** beautifully designed, accessible, and customizable components based on + [`shadcn/ui`](https://ui.shadcn.com/) +- **Integrations:** a growing list of plug-and-play integrations for popular APIs and Databases. +- **CSS/Styling:** built-in, pre-defined themes powered by **UnoCSS**, an instant, on-demand atomic + CSS engine. +- **CLI:** command-line interface (CLI) to help you develop and deploy Netzo applications. ## Quick start @@ -89,11 +82,10 @@ deno task start netzo deploy --build --production ``` -> To deploy your project, you need to create a project in the -> [Netzo Platform](https://app.netzo.io) if you don't already have one. +> To deploy your project, you need to create a project in the [Netzo Platform](https://app.netzo.io) +> if you don't already have one. ## Contribute Contributions are always welcome! Please read the -[contribution guideline](https://github.com/netzo/netzo/blob/main/contributing.md) -first. +[contribution guideline](https://github.com/netzo/netzo/blob/main/contributing.md) first. diff --git a/readme.md b/readme.md index c7cc51daf..0af30c800 100644 --- a/readme.md +++ b/readme.md @@ -9,8 +9,7 @@ Productive open-source framework for building business web apps. [Website](https://netzo.io) · [Docs](https://netzo.io/docs) · -[Issues](https://github.com/netzo/netzo/issues) · -[Discord](https://discord.gg/tbDUpRQCTk) +[Issues](https://github.com/netzo/netzo/issues) · [Discord](https://discord.gg/tbDUpRQCTk) --- @@ -22,43 +21,37 @@ Productive open-source framework for building business web apps.

    -> **We are on our [road to v1](https://netzo.io/roadmap/)! Be sure to pin -> version via `netzo@X.Y.Z` to ensure things don't break.** +> **We are on our [road to v1](https://netzo.io/roadmap/)! Be sure to pin version via `netzo@X.Y.Z` +> to ensure things don't break.** ## What is Netzo? -Netzo is a platform and batteries-included meta-framework for Deno Fresh. It -offers a collection of modules and opinionated best practices, empowering -developers to build web apps faster without sacrificing flexibility. +Netzo is a platform and batteries-included meta-framework for Deno Fresh. It offers a collection of +modules and opinionated best practices, empowering developers to build web apps faster without +sacrificing flexibility. - **Platform:** a cloud platform to deploy, manage, and scale your apps. -- **Framework:** built on **Deno Fresh**, a next-gen web framework designed for - rapid development. +- **Framework:** built on **Deno Fresh**, a next-gen web framework designed for rapid development. ## Why Netzo? > "Low-code tools make the first 60% easy, and the remaining 40% impossible." -Custom business app development has challenges. Traditional development is -complex and time-consuming. In business software not only is flexibility but -speed and efficiency are paramount. Our goal is to provide full-code flexibility -at no-code speeds boosting developer productivity and enabling them to build -apps 10x faster. +Custom business app development has challenges. Traditional development is complex and +time-consuming. In business software not only is flexibility but speed and efficiency are paramount. +Our goal is to provide full-code flexibility at no-code speeds boosting developer productivity and +enabling them to build apps 10x faster. ## Main Features -- **Authentication:** built-in user management and role-based access control - (RBAC). -- **Database:** built-in **Deno KV** database, a fast, reliable, and secure - key-value database. -- **Components:** beautifully designed, accessible, and customizable components - based on [`shadcn/ui`](https://ui.shadcn.com/) -- **Integrations:** a growing list of plug-and-play integrations for popular - APIs and Databases. -- **CSS/Styling:** built-in, pre-defined themes powered by **UnoCSS**, an - instant, on-demand atomic CSS engine. -- **CLI:** command-line interface (CLI) to help you develop and deploy Netzo - applications. +- **Authentication:** built-in user management and role-based access control (RBAC). +- **Database:** built-in **Deno KV** database, a fast, reliable, and secure key-value database. +- **Components:** beautifully designed, accessible, and customizable components based on + [`shadcn/ui`](https://ui.shadcn.com/) +- **Integrations:** a growing list of plug-and-play integrations for popular APIs and Databases. +- **CSS/Styling:** built-in, pre-defined themes powered by **UnoCSS**, an instant, on-demand atomic + CSS engine. +- **CLI:** command-line interface (CLI) to help you develop and deploy Netzo applications. ## Quick start @@ -89,11 +82,10 @@ deno task start netzo deploy --build --production ``` -> To deploy your project, you need to create a project in the -> [Netzo Platform](https://app.netzo.io) if you don't already have one. +> To deploy your project, you need to create a project in the [Netzo Platform](https://app.netzo.io) +> if you don't already have one. ## Contribute Contributions are always welcome! Please read the -[contribution guideline](https://github.com/netzo/netzo/blob/main/contributing.md) -first. +[contribution guideline](https://github.com/netzo/netzo/blob/main/contributing.md) first. diff --git a/tasks/lint_analysis.ipynb b/tasks/lint_analysis.ipynb index bf6c8b36e..18ca5db12 100644 --- a/tasks/lint_analysis.ipynb +++ b/tasks/lint_analysis.ipynb @@ -175,9 +175,7 @@ " { files: string[]; count: number }\n", "> = Object.keys(groupedByCode).reduce((acc, code) => {\n", " const diagnostics = groupedByCode[code];\n", - " const filenames = diagnostics.map((diagnostic) =>\n", - " diagnostic.filename.replace(cwd, \"\")\n", - " );\n", + " const filenames = diagnostics.map((diagnostic) => diagnostic.filename.replace(cwd, \"\"));\n", "\n", " const count = diagnostics.length;\n", "\n", @@ -191,7 +189,7 @@ " return acc;\n", "}, {} as Record);\n", "\n", - "console.log(filenamesAndCountsByCode);\n" + "console.log(filenamesAndCountsByCode);" ] } ], diff --git a/tests/fixture-plugins-unocss/islands/InsertCssRules.tsx b/tests/fixture-plugins-unocss/islands/InsertCssRules.tsx index 1cdc55963..54bacb5e1 100644 --- a/tests/fixture-plugins-unocss/islands/InsertCssRules.tsx +++ b/tests/fixture-plugins-unocss/islands/InsertCssRules.tsx @@ -32,18 +32,14 @@ export default function InsertCssRules() {

    Default Number of __FRSH_UNOCSS CssRules :

    - {numDefCssRules.value - ? numDefCssRules.value - : "Error : Cannot get cssrules"} + {numDefCssRules.value ? numDefCssRules.value : "Error : Cannot get cssrules"}

    Current Number of __FRSH_UNOCSS CssRules :

    - {numCssRules.value - ? numCssRules.value - : "Error : Cannot get cssrules"} + {numCssRules.value ? numCssRules.value : "Error : Cannot get cssrules"}