From bd6add9482b11ba617526752644a4ce7f0d08dcd Mon Sep 17 00:00:00 2001 From: Helder Oliveira Date: Fri, 27 Sep 2024 15:22:11 +0100 Subject: [PATCH 1/4] =?UTF-8?q?docs:=20=F0=9F=93=9D=20Include=20migration?= =?UTF-8?q?=20steps=20for=20Fleek.co's=20CLI=20#225=20(#226)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Why? Include migration steps for Fleek.co's CLI. ## How? - Update CLI Overview page, including the migration steps ## Tickets? - [PLAT-1485](https://linear.app/fleekxyz/issue/PLAT-1485/docs-for-migrating-fleekcos-cli) - [PLAT-1491](https://linear.app/fleekxyz/issue/PLAT-1491/docs-for-migrating-cicd-github-action-via-cli) ## Contribution checklist? - [x] The commit messages are detailed - [x] The `build` command runs locally - [ ] Assets or static content are linked and stored in the project - [ ] Document filename is named after the slug - [ ] You've reviewed spelling using a grammar checker - [ ] For documentation, guides or references, you've tested the commands and steps - [ ] You've done enough research before writing ## Security checklist? - [ ] Sensitive data has been identified and is being protected properly - [ ] Injection has been prevented (parameterized queries, no eval or system calls) - [ ] The Components are escaping output (to prevent XSS) ## References? Optionally, provide references such as links ## Preview? Optionally, provide the preview url here --------- Co-authored-by: nlc616 <97002998+nlc616@users.noreply.github.com> --- .../actions/spell-checker/ignore_words.txt | 2 + src/content/docs/CLI/index.md | 52 +++++++++++++++++++ 2 files changed, 54 insertions(+) diff --git a/.github/actions/spell-checker/ignore_words.txt b/.github/actions/spell-checker/ignore_words.txt index bd2a8097..2eb3b1ee 100755 --- a/.github/actions/spell-checker/ignore_words.txt +++ b/.github/actions/spell-checker/ignore_words.txt @@ -348,6 +348,7 @@ ru ruby russia s3 +saas saml sandbox sanitizer @@ -430,6 +431,7 @@ thursday’s tld tls token +toolset tooltip tooltips totp diff --git a/src/content/docs/CLI/index.md b/src/content/docs/CLI/index.md index 81f3af6d..1389dd8c 100644 --- a/src/content/docs/CLI/index.md +++ b/src/content/docs/CLI/index.md @@ -17,6 +17,10 @@ The Fleek Platform CLI is a command-line interface, that lets users interact wit In the next steps, we’re going to install the CLI, create a project and deploy a simple page. +:::warn +Fleek.co users migrating to the new Fleek Platform, please check the [migrating from Fleek.co to Fleek-platform CLI](#migrating-from-fleekco-to-fleek-platform-cli) section. +::: + ## Install To install the CLI launch your terminal and run: @@ -190,3 +194,51 @@ fleek logout ``` ✅ Successfully logged out. ``` + +## Migrating from Fleek.co to Fleek-platform CLI + +The Fleek.co's [CLI](https://www.npmjs.com/package/@fleekhq/cli) features are part of Fleek Platform CLI, which brings enhanced performance, new features, and broader support for all your development needs. + +If you use [Fleek CLI](https://www.npmjs.com/package/@fleekhq/cli) to interact with Fleek.co's Services, migrate to the Fleek Platform, familiarizing yourself with the following changes or consult our [CLI docs](/docs/cli) for a deep dive. + +### Global installation + +The CLI global installation process has changed. + +:::warn +To avoid conflicts, uninstall the deprecated `@fleekhq/fleek-cli` package before installing the new Fleek Platform CLI. This will free up the fleek command for use with the new version. +::: + +```sh +# Old install command +npm install -g @fleekhq/fleek-cli + +# New install command +npm install -g @fleek-platform/cli +``` + +Learn more by reading the CLI documentation [here](/docs/cli). + +### Sites Init & Deploy + +Initializing and deploying a static site has changed. To initialize a Fleek site: + +```sh +# Old site init command +fleek site:init + +# New site init command +fleek sites init +``` + +To deploy the Fleek site: + +```sh +# Old site deploy command +fleek site:deploy + +# New site deploy command +fleek sites deploy +``` + +You can learn about other Sites service features [here](docs/cli/sites). From a480b981c44c97ac70b754c9a9f3cd545562a17a Mon Sep 17 00:00:00 2001 From: Tobiloba Adedeji <96334363+tobySolutions@users.noreply.github.com> Date: Fri, 27 Sep 2024 15:24:48 +0100 Subject: [PATCH 2/4] fix: sidebar category capitalizing (#242) ## Why? The sidebar category names encountered an issue that caused them all to be lowercase due to a missing style. This PR fixes that. ## Contribution checklist? - [x] The commit messages are detailed - [x] The `build` command runs locally - [x] Assets or static content are linked and stored in the project - [x] Document filename is named after the slug - [x] You've reviewed spelling using a grammar checker - [x] For documentation, guides or references, you've tested the commands and steps - [x] You've done enough research before writing ## Security checklist? - [x] Sensitive data has been identified and is being protected properly - [x] Injection has been prevented (parameterized queries, no eval or system calls) - [x] The Components are escaping output (to prevent XSS) --------- Co-authored-by: nlc616 <97002998+nlc616@users.noreply.github.com> --- src/components/Sidebar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx index 7800a05d..8b30104b 100644 --- a/src/components/Sidebar.tsx +++ b/src/components/Sidebar.tsx @@ -93,7 +93,7 @@ const SidebarMenu: FC = ({ data, pathname }) => { ? activeItemRef : null } - className={`inline-block w-full font-plex-sans text-16 leading-loose text-gray-dark-11 transition duration-150 hover:opacity-100 ${ + className={`inline-block w-full font-plex-sans text-16 capitalize leading-loose text-gray-dark-11 transition duration-150 hover:opacity-100 ${ isActiveSlug(item.slug) && isActiveCategory(item.category) ? `${activeItemStyle}` : 'opacity-80' From 7fd4a1e83868e4f7af259f9d406196c82f64389f Mon Sep 17 00:00:00 2001 From: Helder Oliveira Date: Fri, 27 Sep 2024 15:28:13 +0100 Subject: [PATCH 3/4] =?UTF-8?q?docs:=20=F0=9F=93=9D=20Include=20migration?= =?UTF-8?q?=20steps=20for=20Fleek.co's=20SDK=20(#225)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Why? Include migration steps for Fleek.co's SDK. ⚠️ Related to fleek.co's doc https://github.com/FleekHQ/fleek-docs/pull/167 ## How? - Update SDK Overview page, including the migration steps ## Tickets? - [PLAT-1484](https://linear.app/fleekxyz/issue/PLAT-1484/docs-for-migrating-fleekcos-sdk) ## Contribution checklist? - [x] The commit messages are detailed - [x] The `build` command runs locally - [ ] Assets or static content are linked and stored in the project - [ ] Document filename is named after the slug - [ ] You've reviewed spelling using a grammar checker - [ ] For documentation, guides or references, you've tested the commands and steps - [ ] You've done enough research before writing ## Security checklist? - [ ] Sensitive data has been identified and is being protected properly - [ ] Injection has been prevented (parameterized queries, no eval or system calls) - [ ] The Components are escaping output (to prevent XSS) ## References? Optionally, provide references such as links ## Preview? Screenshot 2024-09-17 at 11 11 01 --------- Co-authored-by: nlc616 <97002998+nlc616@users.noreply.github.com> --- src/content/docs/SDK/index.md | 100 ++++++++++++++++++++++++++++++++++ 1 file changed, 100 insertions(+) diff --git a/src/content/docs/SDK/index.md b/src/content/docs/SDK/index.md index d8ae852d..4e345066 100644 --- a/src/content/docs/SDK/index.md +++ b/src/content/docs/SDK/index.md @@ -15,6 +15,10 @@ tags: The Fleek Platform SDK is a TypeScript library that allows you to interact with Fleek’s services. It’s composed of methods that you can leverage to build your own application on top of Fleek’s services. +:::warn +Fleek.co users migrating to the new Fleek Platform, please check the [migrating from Fleek.co to Fleek-platform SDK](#migrating-from-fleekco-to-fleek-platform-sdk) section. +::: + ## Install The SDK is available as an NPM package. @@ -129,3 +133,99 @@ const fleekSdk = new FleekSdk({ accessTokenService: applicationService }); ``` + +## Migrating from Fleek.co to Fleek Platform SDK + +The Fleek.co's [SDK](https://www.npmjs.com/package/@fleekhq/sdk) and [Storage](https://www.npmjs.com/package/@fleekhq/fleek-storage-js) features are part of Fleek Platform SDK, which brings enhanced performance, new features, and broader support for all your development needs. + +Learn how to migrate to Fleek Platform with these steps or consult our [SDK docs](/docs/sdk) for a deep dive. + +### Fleek Storage JS + +If you use [Fleek Storage Js](https://www.npmjs.com/package/@fleekhq/fleek-storage-js) to interact with Fleek Storage, migrate to the Fleek Platform, implementing the following changes: + +```js +# Old syntax +import { Fleek } from '@fleekhq/sdk'; + +const sdk = new Fleek({ + apiKey: '', + assetCanisterId: '', +}); +``` + +```js +# New syntax +import { FleekSdk, ApplicationAccessTokenService } from '@fleek-platform/sdk'; + +# Using the Application Token +# Learn more about the available token services +# by following the link below +const applicationService = new ApplicationAccessTokenService({ + clientId: , +}); + +const fleekSdk = new FleekSdk({ + accessTokenService: applicationService +}); +``` + +Learn more by reading the SDK documentation [here](/docs/sdk). + +### Fleek.co's SDK + +If you use [Fleek.co's SDK](https://www.npmjs.com/package/@fleekhq/sdk) to interact with Fleek APIs and Internet Computer, migrate to the Fleek Platform, implementing the following changes: + +```js +# Old syntax +import { Fleek } from '@fleekhq/sdk'; + +const sdk = new Fleek({ + apiKey: '', + assetCanisterId: '', +}); + +# Using IPFS +await sdk.ipfs().add(...); +``` + +```js +# New syntax +import { FleekSdk, ApplicationAccessTokenService } from '@fleek-platform/sdk'; + +# Using the Application token service +# Learn more about the available token services +# by following the link below +const applicationService = new ApplicationAccessTokenService({ + clientId: , +}); + +const fleekSdk = new FleekSdk({ + accessTokenService: applicationService +}); + +# Using Storage +# It'll default to IPFS +const result = await fleekSdk.storage().uploadFile({ + file, + onUploadProgress, +}); +``` + +Support for Internet Computer asset canister has been deprecated. You must use the Fleek Platform [Storage](/docs/sdk/storage), which includes similar methods as follows: + +```js +# Deprecated feature +const items = await sdk.assets().listAll(); +const item = await sdk.assets().get(key); +``` + +```js +# Storage feature +const items = await fleekSdk.storage().list(); + +# Get by CID +const item = await fleekSdk.storage().get({ cid }); +``` + +Learn more about [Storage](/docs/sdk/storage) and feature coverage by reading the SDK's Storage documentation [here](/docs/sdk/storage). From d4fb905584a1da881ab99703cdcaccf283aeac17 Mon Sep 17 00:00:00 2001 From: Helder Oliveira Date: Fri, 27 Sep 2024 15:42:20 +0100 Subject: [PATCH 4/4] =?UTF-8?q?docs:=20=F0=9F=93=9D=20CLI's=20GitHub=20Act?= =?UTF-8?q?ion=20generator,=20including=20Fleek.co's=20migration=20(#229)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Why? CLI's GitHub Action generator, including Fleek.co's migration instructions. ## How? - Created the document - Provided detailed instructions ## Tickets? - [PLAT-1491](https://linear.app/fleekxyz/issue/PLAT-1491/docs-for-migrating-cicd-github-action-via-cli) ## Contribution checklist? - [x] The commit messages are detailed - [x] The `build` command runs locally - [ ] Assets or static content are linked and stored in the project - [ ] Document filename is named after the slug - [ ] You've reviewed spelling using a grammar checker - [ ] For documentation, guides or references, you've tested the commands and steps - [ ] You've done enough research before writing ## Security checklist? - [ ] Sensitive data has been identified and is being protected properly - [ ] Injection has been prevented (parameterized queries, no eval or system calls) - [ ] The Components are escaping output (to prevent XSS) ## References? Optionally, provide references such as links ## Preview? Screenshot 2024-09-18 at 16 32 32 --------- Co-authored-by: nlc616 <97002998+nlc616@users.noreply.github.com> --- src/content/docs/CLI/GitHub Actions/index.md | 89 ++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 src/content/docs/CLI/GitHub Actions/index.md diff --git a/src/content/docs/CLI/GitHub Actions/index.md b/src/content/docs/CLI/GitHub Actions/index.md new file mode 100644 index 00000000..620f841f --- /dev/null +++ b/src/content/docs/CLI/GitHub Actions/index.md @@ -0,0 +1,89 @@ +--- +order: 10 +title: GitHub Actions +date: 2023-01-10 +desc: Create a GitHub Action for deploying a Fleek Site +keywords: [services, documentation, getting started] +tags: + - CLI + - Guide + - Learn + - Fleek + - GitHub + - CI/CD +--- + +# GitHub Actions + +Use custom GitHub Actions to deploy your site to Fleek instead of using the CLI's [Site deploy](/docs/cli/sites#deploy-a-site) command. This approach is suitable if you have an existing repository that you want to deploy on [Fleek Platform](https://fleek.xyz). + +The Fleek-platform CLI can generate a GitHub Action (yaml) for deploying a [Fleek Site](/docs/cli/site) by automating the process of building and publishing it. It ensures that your latest changes are quickly and consistently pushed whenever you update the repository, e.g. on main branch update. + +### Create a GitHub Action for Fleek Sites deployment + +First, ensure that you have initialized a [Fleek Site](/docs/cli/sites#initialize-the-fleek-site), if you haven't done already you can learn about it [here](/docs/cli/sites#initialize-the-fleek-site). + +After initializing a Fleek Site, you can run the `ci` (Continuous Integration) command: + +```sh +fleek sites ci +``` + +A wizard will guide you to create a GitHub Action configuration file of type `json`, `js` or `ts`, e.g. `fleek.config.json`. + +The process saves the file in the local GitHub Workflows directory. You can optionally customize the path. + +```sh +.github/workflows/fleek-deploy.yaml +``` + +### Configure the GitHub repository settings + +On [Create a GitHub Action](#create-a-github-action) completion, the wizard will display the `token` and `projectId` to have configured in the GitHub repository settings, e.g. [GitHub Secrets](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions). + +Here's an example: + +```sh +Name Value +------------------------------------------- +FLEEK_TOKEN +FLEEK_PROJECT_ID +``` + +:::note +You can create your own GitHub Action with any necessary customizations; The Fleek-platform CLI's generated GitHub Action provides a starting point for deploying your site to Fleek. +::: + +Next, you can navigate to the GitHub's Actions tab. Commit and push a change to your repository in order to trigger the Fleek CI to be executed. + +You can access the Actions tab of you repository at `https://github.com//`, e.g. for the Fleek's Website [repository](https://github.com/fleek-platform/website) you'd access it [here](https://github.com/fleek-platform/website/actions). + +### Migrating from Fleek.co to Fleek-platform CLI + +Users migrating from Fleek.co should adapt their setup to use the Fleek Platform instructions described [here](#create-a-github-action-for-fleek-sites-deployment). + +Alternatively, you can use the following as a reference to perform the required changes. + +1. Backup the original Fleek deploy yaml file. + +```sh +git mv .github/workflows/deploy.yml .github/workflows/deploy.yml.bak +``` + +You can delete this file later. But keep it as a reference to move any customization to the new GitHub Action. + +2. Remove the secret `FLEEK_API_KEY` from GitHub's repository secrets, read the documentation [here](https://docs.github.com/en/actions/security-for-github-actions/security-guides/using-secrets-in-github-actions) + +3. Generate a new GitHub Action as instructed [here](#create-a-github-action-for-fleek-sites-deployment) + +4. Use the step 1's backup file to copy any custom steps or commands onto the new GitHub Action file + +Next, you can navigate to the GitHub's Actions tab. Commit and push a change to your repository in order to trigger the Fleek CI to be executed. + +You can access the Actions tab of you repository at `https://github.com//`, e.g. for the Fleek's Website [repository](https://github.com/fleek-platform/website) you'd access it [here](https://github.com/fleek-platform/website/actions). + +5. When happy, feel free to delete the backup file + +```sh +git rm .github/workflows/deploy.yml.bak +```