diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8fcb73389..3d78e77a4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -108,9 +108,9 @@ pnpm run lint Diagnostic tool that checks for the following: -- Unused CSS -- Svelte A11y hints -- TypeScript compiler errors +- Unused CSS +- Svelte A11y hints +- TypeScript compiler errors ```bash pnpm run check @@ -130,11 +130,11 @@ doc-548-submit-a-pull-request-section-to-contribution-guide When `TYPE` can be: -- **feat** - is a new feature -- **doc** - documentation only changes -- **cicd** - changes related to CI/CD system -- **fix** - a bug fix -- **refactor** - code change that neither fixes a bug nor adds a feature +- **feat** - is a new feature +- **doc** - documentation only changes +- **cicd** - changes related to CI/CD system +- **fix** - a bug fix +- **refactor** - code change that neither fixes a bug nor adds a feature **All PRs must include a commit message with a description of the changes made!** @@ -175,12 +175,12 @@ $ git push origin [name_of_your_new_branch] Before committing always make sure to run all available tools to improve the codebase: -- Formatter - - `pnpm run format` -- Tests - - `pnpm test` -- Diagnostics - - `pnpm run check` +- Formatter + - `pnpm run format` +- Tests + - `pnpm test` +- Diagnostics + - `pnpm run check` ### Performance @@ -188,9 +188,9 @@ Page load times are a key consideration for users of all browsers and device typ There are some general things we can do in front-end development: -- Minimize HTTP requests -- Minimize blocking – content should be readable before client-side processing -- Lazy load "supplementary" content, especially images +- Minimize HTTP requests +- Minimize blocking – content should be readable before client-side processing +- Lazy load "supplementary" content, especially images ### Don't Repeat Yourself (DRY) @@ -202,12 +202,12 @@ If you stick to this principle, you will ensure that you will only ever need to Separate _structure_ from _presentation_ from _behavior_ to aid maintainability and understanding. -- Keep CSS (presentation), JS (behavior) and HTML (structure) in the same respective Svelte component -- Avoid writing inline CSS or Javascript in HTML -- Avoid writing CSS or HTML in Javascript -- Don't choose HTML elements to imply style -- Where appropriate, use CSS or Svelte rather than Javascript for animations and transitions -- Try to use templates when defining markup in Javascript +- Keep CSS (presentation), JS (behavior) and HTML (structure) in the same respective Svelte component +- Avoid writing inline CSS or Javascript in HTML +- Avoid writing CSS or HTML in Javascript +- Don't choose HTML elements to imply style +- Where appropriate, use CSS or Svelte rather than Javascript for animations and transitions +- Try to use templates when defining markup in Javascript ### Write code to be read diff --git a/README.md b/README.md index e37369791..9e113f121 100644 --- a/README.md +++ b/README.md @@ -10,8 +10,8 @@ Appwrite Console has been built with the following frameworks: -- [Svelte](https://svelte.dev/) -- [Svelte Kit](https://kit.svelte.dev/) +- [Svelte](https://svelte.dev/) +- [Svelte Kit](https://kit.svelte.dev/) ## Developer Experience diff --git a/src/routes/(console)/project-[project]/createVariable.svelte b/src/routes/(console)/project-[project]/createVariable.svelte index 3987af20c..e8c2bf9b7 100644 --- a/src/routes/(console)/project-[project]/createVariable.svelte +++ b/src/routes/(console)/project-[project]/createVariable.svelte @@ -44,9 +44,9 @@ title={`${selectedVar ? 'Update' : 'Create'} ${isGlobal ? 'global' : 'environment'} variable`}> - Set the environment variables or secret keys that will be passed to {isGlobal - ? `all ${product}s within your project` - : `your ${product}s`}. + Set the environment variables or secret keys that will be passed to {!isGlobal + ? `your ${product}` + : `all functions and sites within your project`}. diff --git a/src/routes/(console)/project-[project]/sites/(components)/deploymentSource.svelte b/src/routes/(console)/project-[project]/sites/(components)/deploymentSource.svelte index c1bb30049..caca20106 100644 --- a/src/routes/(console)/project-[project]/sites/(components)/deploymentSource.svelte +++ b/src/routes/(console)/project-[project]/sites/(components)/deploymentSource.svelte @@ -12,8 +12,6 @@ import { ActionMenu, Layout, Popover, Icon } from '@appwrite.io/pink-svelte'; export let deployment: Models.Deployment; - - $: console.log(deployment); {#if deployment.type === 'vcs'} @@ -40,13 +38,14 @@ {deployment.providerBranch} {#if deployment?.providerCommitMessage && deployment?.providerCommitHash && deployment?.providerCommitUrl} + {deployment?.providerCommitHash?.substring(0, 7)} - {deployment.providerCommitMessage} + {deployment.providerCommitMessage.substring(0, 15)}... {/if} diff --git a/src/routes/(console)/project-[project]/sites/(components)/logs.svelte b/src/routes/(console)/project-[project]/sites/(components)/logs.svelte index 4ae294c95..86d9a930e 100644 --- a/src/routes/(console)/project-[project]/sites/(components)/logs.svelte +++ b/src/routes/(console)/project-[project]/sites/(components)/logs.svelte @@ -79,21 +79,24 @@ lightCyan: [133, 219, 216] }; + // TODO: Fix the buildLogs to return object, currently its a string. function formatLogs(logs: { timestamp: string; content: string }[] = []) { let output = ''; - // TODO: type class needs an update const sum = logs.map((n) => `${n.timestamp} ${n.content}`).join('\n'); const iterator = ansicolor.parse(sum); - for (const element of iterator) { + for (const element of iterator.spans) { if (element.color && !element.color.name) output += `${element.text}`; - else output += `${element.text}`; + else output += `${element.text}`; } return output; } async function cancelDeployment() { try { - await sdk.forProject.sites.updateDeploymentBuild(deployment.resourceId, deployment.$id); + await sdk.forProject.sites.updateDeploymentBuild( + deployment.resourceId, + deployment.$id + ); await invalidate(Dependencies.DEPLOYMENTS); addNotification({ type: 'success', @@ -129,7 +132,9 @@ -
{@html formatLogs(buildLogs)}
+
+        {formatLogs(buildLogs)}
+    
diff --git a/src/routes/(console)/project-[project]/sites/create-site/deploying/+page.svelte b/src/routes/(console)/project-[project]/sites/create-site/deploying/+page.svelte index 0d141f98b..27ee5db1d 100644 --- a/src/routes/(console)/project-[project]/sites/create-site/deploying/+page.svelte +++ b/src/routes/(console)/project-[project]/sites/create-site/deploying/+page.svelte @@ -8,8 +8,6 @@ import Logs from '../../(components)/logs.svelte'; export let data; - - $: console.log(data.deployment); diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/domains/+page.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/domains/+page.svelte index ad946681f..a72c50e9d 100644 --- a/src/routes/(console)/project-[project]/sites/site-[site]/domains/+page.svelte +++ b/src/routes/(console)/project-[project]/sites/site-[site]/domains/+page.svelte @@ -2,7 +2,7 @@ import { base } from '$app/paths'; import { page } from '$app/stores'; import { PaginationWithLimit } from '$lib/components/index.js'; - import { Button, InputCheckbox, InputSearch } from '$lib/elements/forms'; + import { Button, InputSearch } from '$lib/elements/forms'; import Link from '$lib/elements/link.svelte'; import { toLocaleDateTime } from '$lib/helpers/date'; import Container from '$lib/layout/container.svelte'; @@ -35,21 +35,17 @@ - Domain Updated {#each data.domains.rules as domain} - - - { limit, query, search, - logs: await sdk.forProject.sites.listLogs(params.site, [ - Query.limit(limit), - Query.offset(offset), - Query.orderDesc(''), - ...parsedQueries.values() - ], search), - site, + logs: await sdk.forProject.sites.listLogs( + params.site, + [ + Query.limit(limit), + Query.offset(offset), + Query.orderDesc(''), + ...parsedQueries.values() + ], + search + ), + site }; }; diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/settings/deleteModal.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/settings/deleteModal.svelte index b37110436..76dd3046b 100644 --- a/src/routes/(console)/project-[project]/sites/site-[site]/settings/deleteModal.svelte +++ b/src/routes/(console)/project-[project]/sites/site-[site]/settings/deleteModal.svelte @@ -38,7 +38,7 @@ icon="exclamation" state="warning">

- Are you sure you want to delete this function and all associated deployments from your + Are you sure you want to delete this site and all associated deployments from your project?

diff --git a/src/routes/(console)/project-[project]/sites/site-[site]/settings/updateRepository.svelte b/src/routes/(console)/project-[project]/sites/site-[site]/settings/updateRepository.svelte index e85915581..3c26c9de7 100644 --- a/src/routes/(console)/project-[project]/sites/site-[site]/settings/updateRepository.svelte +++ b/src/routes/(console)/project-[project]/sites/site-[site]/settings/updateRepository.svelte @@ -82,7 +82,7 @@ silentMode || undefined, selectedDir || undefined ); - await invalidate(Dependencies.FUNCTION); + await invalidate(Dependencies.SITE); addNotification({ type: 'success', message: `${site.name} git configuration has been updated successfully` diff --git a/src/routes/(console)/project-[project]/updateVariables.svelte b/src/routes/(console)/project-[project]/updateVariables.svelte index db30c01ce..9095e604a 100644 --- a/src/routes/(console)/project-[project]/updateVariables.svelte +++ b/src/routes/(console)/project-[project]/updateVariables.svelte @@ -191,12 +191,12 @@ {#if isGlobal}

- Set the environment variables or secret keys that will be passed to all functions within - your project. + Set the environment variables or secret keys that will be passed to all functions and + sites within your project.

{:else}

- Set the environment variables or secret keys that will be passed to your function. + Set the environment variables or secret keys that will be passed to your {product}. Global variables can be found in project settings - - - Import new {isGlobal ? 'global' : 'environment'} variables - +

- Import new {isGlobal ? 'global' : 'environment'} variables from + {title} from .env - file that will be passed to {isGlobal - ? 'all functions within your project' - : 'your function'}. + file that will be passed to {!isGlobal + ? `your ${product}` + : 'all functions and sites within your project'}.

{#if variableList.total > 0}