From 268fb11ec337be5ecb9d236cd788579ae071b55a Mon Sep 17 00:00:00 2001 From: koilebeit Date: Tue, 23 Jul 2024 17:18:42 +0200 Subject: [PATCH 1/8] add ci.yml --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..6e6449f8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,29 @@ +name: Continuous Integration + +on: + pull_request: + branches: [main] + +jobs: + prettier: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.head_ref }} + persist-credentials: false + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '21' # Specify the Node.js version you want + + - name: Install Prettier + run: npm install --global prettier @shopify/prettier-plugin-liquid + + - name: Check formatting + run: prettier --check "**/*.{js,css,md,liquid,html}" # Specify the file extensions you want to check + # If prettier finds incorrectly formatted code, it exits with 1 and fails the job \ No newline at end of file From 558a11ff15282da4342773c0eb4ac96dcfa41e93 Mon Sep 17 00:00:00 2001 From: koilebeit Date: Wed, 24 Jul 2024 16:28:06 +0200 Subject: [PATCH 2/8] configure ref and repository --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6e6449f8..5b485f8f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,7 +13,8 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - ref: ${{ github.head_ref }} + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} persist-credentials: false - name: Setup Node.js @@ -26,4 +27,4 @@ jobs: - name: Check formatting run: prettier --check "**/*.{js,css,md,liquid,html}" # Specify the file extensions you want to check - # If prettier finds incorrectly formatted code, it exits with 1 and fails the job \ No newline at end of file + # If prettier finds incorrectly formatted code, it exits with 1 and fails the job \ No newline at end of file From 901102575922289e961c8b36c36ba00191266e5a Mon Sep 17 00:00:00 2001 From: koilebeit Date: Thu, 25 Jul 2024 15:44:27 +0200 Subject: [PATCH 3/8] use node v22 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b485f8f..f6b360e1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: - name: Setup Node.js uses: actions/setup-node@v4 with: - node-version: '21' # Specify the Node.js version you want + node-version: '22' # Specify the Node.js version you want - name: Install Prettier run: npm install --global prettier @shopify/prettier-plugin-liquid From 76c3947d9e355579dc7ba90b6cbc34cb768ce340 Mon Sep 17 00:00:00 2001 From: koilebeit Date: Thu, 25 Jul 2024 17:17:33 +0200 Subject: [PATCH 4/8] add .prettierignore --- .prettierignore | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 00000000..67d93db6 --- /dev/null +++ b/.prettierignore @@ -0,0 +1,5 @@ +_data/** +_plugins/** +_site/** +assets/** +objects/** From be47e2202ebe8622ea4fad38d8b98f207763c964 Mon Sep 17 00:00:00 2001 From: koilebeit Date: Fri, 26 Jul 2024 16:16:04 +0200 Subject: [PATCH 5/8] update ci.yml --- .github/workflows/ci.yml | 9 ++++----- .prettierrc | 11 +++++++++++ package.json | 6 ++++++ 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 .prettierrc create mode 100644 package.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6b360e1..00834444 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,9 +22,8 @@ jobs: with: node-version: '22' # Specify the Node.js version you want - - name: Install Prettier - run: npm install --global prettier @shopify/prettier-plugin-liquid + - name: Install Dependencies + run: npm ci # Using npm ci for a clean install based on package-lock.json - - name: Check formatting - run: prettier --check "**/*.{js,css,md,liquid,html}" # Specify the file extensions you want to check - # If prettier finds incorrectly formatted code, it exits with 1 and fails the job \ No newline at end of file + - name: Check Formatting + run: npx prettier --check "**/*.{js,css,md,html}" \ No newline at end of file diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..4d83a58f --- /dev/null +++ b/.prettierrc @@ -0,0 +1,11 @@ +{ + "plugins": ["@shopify/prettier-plugin-liquid"], + "overrides": [ + { + "files": "*.html", + "options": { + "parser": "liquid-html" + } + } + ] +} \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 00000000..681eb6c5 --- /dev/null +++ b/package.json @@ -0,0 +1,6 @@ +{ + "devDependencies": { + "prettier": "^3.3.0", + "@shopify/prettier-plugin-liquid": "^1.2.2" + } +} From 865e05b51384dfc9d75f699127990409f1aaa93b Mon Sep 17 00:00:00 2001 From: koilebeit Date: Fri, 26 Jul 2024 16:17:33 +0200 Subject: [PATCH 6/8] add package-lock --- package-lock.json | 94 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 package-lock.json diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..a9f328cc --- /dev/null +++ b/package-lock.json @@ -0,0 +1,94 @@ +{ + "name": "forschung.stadtgeschichtebasel.ch", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "devDependencies": { + "@shopify/prettier-plugin-liquid": "^1.5.0" + } + }, + "node_modules/@shopify/liquid-html-parser": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@shopify/liquid-html-parser/-/liquid-html-parser-2.0.3.tgz", + "integrity": "sha512-aIkZ5TJWG7/ztd1sZm5XNpBNTG3B+Q0gv3WN/QahmNQzm2wmKYSHiRLOA8JALAnOGTmH0uqOJ7jzdqoATcZSxw==", + "dev": true, + "dependencies": { + "line-column": "^1.0.2", + "ohm-js": "^16.3.0" + } + }, + "node_modules/@shopify/liquid-html-parser/node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true + }, + "node_modules/@shopify/liquid-html-parser/node_modules/isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha512-+OUdGJlgjOBZDfxnDjYYG6zp487z0JGNQq3cYQYg5f5hKR+syHMsaztzGeml/4kGG55CSpKSpWTY+jYGgsHLgA==", + "dev": true, + "dependencies": { + "isarray": "1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@shopify/liquid-html-parser/node_modules/line-column": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/line-column/-/line-column-1.0.2.tgz", + "integrity": "sha512-Ktrjk5noGYlHsVnYWh62FLVs4hTb8A3e+vucNZMgPeAOITdshMSgv4cCZQeRDjm7+goqmo6+liZwTXo+U3sVww==", + "dev": true, + "dependencies": { + "isarray": "^1.0.0", + "isobject": "^2.0.0" + } + }, + "node_modules/@shopify/liquid-html-parser/node_modules/ohm-js": { + "version": "16.6.0", + "resolved": "https://registry.npmjs.org/ohm-js/-/ohm-js-16.6.0.tgz", + "integrity": "sha512-X9P4koSGa7swgVQ0gt71UCYtkAQGOjciJPJAz74kDxWt8nXbH5HrDOQG6qBDH7SR40ktNv4x61BwpTDE9q4lRA==", + "dev": true, + "engines": { + "node": ">=0.12.1" + } + }, + "node_modules/@shopify/prettier-plugin-liquid": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@shopify/prettier-plugin-liquid/-/prettier-plugin-liquid-1.5.0.tgz", + "integrity": "sha512-CuWjUnBCvq/RTmubEa5RfwW2oP2gYfTXaJ39t4apAYm//1v5Ftvv1bbhEnoEZwCjPshaAJLhSzP9dvCel4cebw==", + "dev": true, + "dependencies": { + "@shopify/liquid-html-parser": "^2.0.3", + "html-styles": "^1.0.0" + }, + "peerDependencies": { + "prettier": "^2.0.0 || ^3.0.0" + } + }, + "node_modules/html-styles": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/html-styles/-/html-styles-1.0.0.tgz", + "integrity": "sha512-cDl5dcj73oI4Hy0DSUNh54CAwslNLJRCCoO+RNkVo+sBrjA/0+7E/xzvj3zH/GxbbBLGJhE0hBe1eg+0FINC6w==", + "dev": true + }, + "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, + "peer": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + } + } +} From a6aa0ff7d82c645207835073db009fe74f79077d Mon Sep 17 00:00:00 2001 From: koilebeit Date: Wed, 14 Aug 2024 16:44:48 +0200 Subject: [PATCH 7/8] add scripts to run prettier locally --- package.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 681eb6c5..fae161b2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,10 @@ { - "devDependencies": { - "prettier": "^3.3.0", - "@shopify/prettier-plugin-liquid": "^1.2.2" + "scripts": { + "check": "prettier --check '**/*.{js,css,md,html}'", + "format": "prettier --write ." + }, + "dependencies": { + "prettier": "^3.3.3", + "@shopify/prettier-plugin-liquid": "^1.5.0" } } From e6e9e90f808f62eca8cb1f5bc0718d122c50b758 Mon Sep 17 00:00:00 2001 From: koilebeit Date: Thu, 15 Aug 2024 10:45:42 +0200 Subject: [PATCH 8/8] format not all files --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fae161b2..828d8062 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "scripts": { "check": "prettier --check '**/*.{js,css,md,html}'", - "format": "prettier --write ." + "format": "prettier --write '**/*.{js,css,md,html}'" }, "dependencies": { "prettier": "^3.3.3",