From 24f4d78cc1c640dbe13d3399b8f4eac3d986f5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonatan=20K=C5=82osko?= Date: Wed, 30 Nov 2022 00:26:28 +0100 Subject: [PATCH] Fix prettier pattern (#1554) --- .github/workflows/deploy.yaml | 8 ++++---- .github/workflows/test.yaml | 14 +++++++------- assets/js/app.js | 26 +++++++++++++++----------- assets/js/hooks/js_view/channel.js | 4 +++- assets/package.json | 4 ++-- 5 files changed, 31 insertions(+), 25 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index d28ce0ea8..5ab05f323 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -21,7 +21,7 @@ jobs: otp-version: ${{ env.otp }} elixir-version: ${{ env.elixir }} - name: Cache Mix - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | deps @@ -33,11 +33,11 @@ jobs: - name: Install mix dependencies run: mix deps.get - name: Install Node - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: "14.x" + node-version: "18.x" - name: Cache npm dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f4c1f42a3..d2c8b0fb1 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -21,7 +21,7 @@ jobs: otp-version: ${{ env.otp }} elixir-version: ${{ env.elixir }} - name: Cache Mix - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | deps @@ -38,11 +38,11 @@ jobs: - name: Run tests run: mix test - name: Install Node - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: - node-version: "14.x" + node-version: "18.x" - name: Cache npm dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.npm key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} @@ -77,7 +77,7 @@ jobs: run: | "C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 - name: Cache Mix - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: | deps @@ -98,12 +98,12 @@ jobs: steps: - uses: actions/checkout@v2 - name: Cache Mix Deps - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: deps key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} - name: Cache Bootstrap - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: tmp key: ${{ runner.os }}-app-${{ hashFiles('.github/scripts/app/bootstrap_mac.sh') }} diff --git a/assets/js/app.js b/assets/js/app.js index 6972704e9..64b078032 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -21,17 +21,21 @@ const csrfToken = document .querySelector("meta[name='csrf-token']") .getAttribute("content"); -const liveSocket = new LiveSocket(window.LIVEBOOK_BASE_URL_PATH + "/live", Socket, { - params: (liveViewName) => { - return { - _csrf_token: csrfToken, - // Pass the most recent user data to the LiveView in `connect_params` - user_data: loadUserData(), - }; - }, - hooks: hooks, - dom: morphdomOptions, -}); +const liveSocket = new LiveSocket( + window.LIVEBOOK_BASE_URL_PATH + "/live", + Socket, + { + params: (liveViewName) => { + return { + _csrf_token: csrfToken, + // Pass the most recent user data to the LiveView in `connect_params` + user_data: loadUserData(), + }; + }, + hooks: hooks, + dom: morphdomOptions, + } +); // Show progress bar on live navigation and form submits registerTopbar(); diff --git a/assets/js/hooks/js_view/channel.js b/assets/js/hooks/js_view/channel.js index bd47d4d1a..cb33ecff3 100644 --- a/assets/js/hooks/js_view/channel.js +++ b/assets/js/hooks/js_view/channel.js @@ -4,7 +4,9 @@ const csrfToken = document .querySelector("meta[name='csrf-token']") .getAttribute("content"); -const socket = new Socket(window.LIVEBOOK_BASE_URL_PATH + "/socket", { params: { _csrf_token: csrfToken } }); +const socket = new Socket(window.LIVEBOOK_BASE_URL_PATH + "/socket", { + params: { _csrf_token: csrfToken }, +}); let channel = null; diff --git a/assets/package.json b/assets/package.json index 3574bfef8..a6478756d 100644 --- a/assets/package.json +++ b/assets/package.json @@ -3,8 +3,8 @@ "scripts": { "deploy": "NODE_ENV=production webpack --mode production", "watch": "webpack --mode development --watch", - "format": "prettier --trailing-comma es5 --write {js,test,css}/**/*.{js,json,css,scss,md} --no-error-on-unmatched-pattern", - "format-check": "prettier --trailing-comma es5 --check {js,test,css}/**/*.{js,json,css,scss,md} --no-error-on-unmatched-pattern", + "format": "prettier --trailing-comma es5 --write '{js,test,css}/**/*.{js,json,css,scss,md}' --no-error-on-unmatched-pattern", + "format-check": "prettier --trailing-comma es5 --check '{js,test,css}/**/*.{js,json,css,scss,md}' --no-error-on-unmatched-pattern", "test": "jest", "test:watch": "jest --watch" },