From d1c84c386b98b98c5e7d916e7a0ea3991e6aec8f Mon Sep 17 00:00:00 2001 From: Tupui <23188539+tupui@users.noreply.github.com> Date: Sun, 4 Aug 2024 11:49:58 +0200 Subject: [PATCH] Add prettier and linter workflow --- .github/workflows/lint.yml | 23 +++++++++++++++++++ website/docs/developers/architecture.mdx | 3 +-- .../docs/developers/dapps_and_contracts.mdx | 4 ++-- website/docs/intro.md | 2 +- website/package-lock.json | 17 ++++++++++++++ website/package.json | 5 +++- 6 files changed, 48 insertions(+), 6 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 6460fdf..1133ea1 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -22,3 +22,26 @@ jobs: with: python-version: "3.12" - uses: pre-commit/action@v3.0.1 + + website: + runs-on: ubuntu-latest + + steps: + - name: Checkout App Repo + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: "20" + cache: "yarn" + cache-dependency-path: "**/yarn.lock" + + - name: Install App Dependencies + run: cd website && yarn --prefer-offline + + - name: Check MDX + run: yarn check:mdx + + - name: Build app + run: yarn build diff --git a/website/docs/developers/architecture.mdx b/website/docs/developers/architecture.mdx index dfead04..509151e 100644 --- a/website/docs/developers/architecture.mdx +++ b/website/docs/developers/architecture.mdx @@ -85,11 +85,10 @@ We also need to think about the most reluctant maintainers and have ways to obse The first version of the dApp will be simple and focus on a basic feature set. We first need to build trust with the community and only then we can expand our feature set with what our users actually need. -The dApp will leverage well-known JS SDKs to propose an effective and familiar user interface. We will start with stellar-sdk, sorobandomains-sdk and soroban-astro-template. This will help us build faster and handle addresses and signing safely so that our system never sees a user's secret key–hence fully non-custodial. On that note, having a list of maintainers allows a project to have “social backups” in the sense that another maintainer can help recover access. +The dApp will leverage well-known JS SDKs to propose an effective and familiar user interface. We will start with stellar-sdk, sorobandomains-sdk and soroban-astro-template. This will help us build faster and handle addresses and signing safely so that our system never sees a user's secret key–hence fully non-custodial. On that note, having a list of maintainers allows a project to have “social backups” in the sense that another maintainer can help recover access. Maintainers will be able to handle all aspects of their projects on the dApp. They will have tools to add or remove maintainers, update metadata and set the new commit hash of the project. Users will be able to view project details and observe its current state. We will link each commit hash to the centralization platform the project is using. The metadata file, similar to a SEP-1, will be rendered to show useful information to users. In general, the interface should be clear enough to show where the data is coming from and there should be a simple way to see the data on-chain and off-chain. - diff --git a/website/docs/developers/dapps_and_contracts.mdx b/website/docs/developers/dapps_and_contracts.mdx index b63ef85..36bb938 100644 --- a/website/docs/developers/dapps_and_contracts.mdx +++ b/website/docs/developers/dapps_and_contracts.mdx @@ -2,8 +2,8 @@ sidebar_position: 2 --- -import CodeBlock from '@theme/CodeBlock'; -import contrac_id from '!!raw-loader!../../../.soroban/soroban_versioning_id'; +import CodeBlock from "@theme/CodeBlock"; +import contrac_id from "!!raw-loader!../../../.soroban/soroban_versioning_id"; # dApps and Contracts diff --git a/website/docs/intro.md b/website/docs/intro.md index 5e62a09..4529955 100644 --- a/website/docs/intro.md +++ b/website/docs/intro.md @@ -3,5 +3,5 @@ sidebar_position: 1 --- # Welcome to Tansu! - + Tansu adds an extra layer of security when developing Open Source projects. In essence, it proposes a solution to track code changes and enable anyone to verify that the code hosted on GitHub is indeed the same. Coupled with other best practices, such as, code signing and attestation of provenance, Tansu guarantees that the code history has not been tempered with. diff --git a/website/package-lock.json b/website/package-lock.json index 34b6bd6..243718f 100644 --- a/website/package-lock.json +++ b/website/package-lock.json @@ -21,6 +21,7 @@ "@docusaurus/module-type-aliases": "3.4.0", "@docusaurus/tsconfig": "3.4.0", "@docusaurus/types": "3.4.0", + "prettier": "^3.3.3", "typescript": "~5.2.2" }, "engines": { @@ -12396,6 +12397,22 @@ "postcss": "^8.4.31" } }, + "node_modules/prettier": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", + "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", + "dev": true, + "license": "MIT", + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/pretty-error": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/pretty-error/-/pretty-error-4.0.0.tgz", diff --git a/website/package.json b/website/package.json index 5786fcb..827ec2f 100644 --- a/website/package.json +++ b/website/package.json @@ -12,7 +12,9 @@ "serve": "docusaurus serve", "write-translations": "docusaurus write-translations", "write-heading-ids": "docusaurus write-heading-ids", - "typecheck": "tsc" + "typecheck": "tsc", + "format:mdx": "prettier --write \"{docs,src/pages}/**/*.{md,mdx}\"", + "check:mdx": "prettier -c \"{docs,src/pages}/**/*.{md,mdx}\"" }, "dependencies": { "@docusaurus/core": "3.4.0", @@ -28,6 +30,7 @@ "@docusaurus/module-type-aliases": "3.4.0", "@docusaurus/tsconfig": "3.4.0", "@docusaurus/types": "3.4.0", + "prettier": "^3.3.3", "typescript": "~5.2.2" }, "browserslist": {