From 459f586ffade3e7deeb11278a40e461afee84dd2 Mon Sep 17 00:00:00 2001 From: Greg Jopa <534034+gregjopa@users.noreply.github.com> Date: Tue, 22 Aug 2023 11:55:09 -0500 Subject: [PATCH 01/10] Use method definition syntax for callbacks --- standard-integration/client/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/standard-integration/client/app.js b/standard-integration/client/app.js index af056c7d..50e8ee9f 100644 --- a/standard-integration/client/app.js +++ b/standard-integration/client/app.js @@ -1,6 +1,6 @@ window.paypal .Buttons({ - createOrder: async () => { + async createOrder() { try { const response = await fetch("/api/orders", { method: "POST", @@ -36,7 +36,7 @@ window.paypal resultMessage(`Could not initiate PayPal Checkout...

${error}`); } }, - onApprove: async (data, actions) => { + async onApprove (data, actions) { try { const response = await fetch(`/api/orders/${data.orderID}/capture`, { method: "POST", From dce7d098c2b66d5c41c822b43ca67c932a0f02db Mon Sep 17 00:00:00 2001 From: Greg Jopa <534034+gregjopa@users.noreply.github.com> Date: Tue, 22 Aug 2023 12:06:01 -0500 Subject: [PATCH 02/10] debug ci --- .github/workflows/validate.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index ba842418..c5ecbcce 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -24,7 +24,9 @@ jobs: run: > find . -name package.json -maxdepth 2 -type f | while read -r file; do directory=$(dirname "$file") - cd "$directory" && npm run format:check && cd - + cd "$directory" + echo "$PWD" + npm run format:check && cd - done - name: 👕 Lint code with ESLint From 91a8743e3bb7f4792addc157cfbf4276bab08469 Mon Sep 17 00:00:00 2001 From: Greg Jopa <534034+gregjopa@users.noreply.github.com> Date: Tue, 22 Aug 2023 12:14:07 -0500 Subject: [PATCH 03/10] debug ci --- .github/workflows/validate.yml | 2 -- test.sh | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 test.sh diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index c5ecbcce..0c299ad6 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -12,8 +12,6 @@ jobs: steps: - name: ⬇️ Checkout repo uses: actions/checkout@v3 - with: - fetch-depth: 0 - name: ⎔ Setup node uses: actions/setup-node@v3 diff --git a/test.sh b/test.sh new file mode 100644 index 00000000..910134b0 --- /dev/null +++ b/test.sh @@ -0,0 +1,6 @@ +find . -name package.json -maxdepth 2 -type f | while read -r file; do + directory=$(dirname "$file") + cd "$directory" + echo "$PWD" + npm run format:check && cd - +done \ No newline at end of file From ab07b284d9bb7ef2efb0481af1c95bc7ac574bcd Mon Sep 17 00:00:00 2001 From: Greg Jopa <534034+gregjopa@users.noreply.github.com> Date: Tue, 22 Aug 2023 12:16:31 -0500 Subject: [PATCH 04/10] add debug flag --- standard-integration/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-integration/package.json b/standard-integration/package.json index 310fefad..7792e51c 100644 --- a/standard-integration/package.json +++ b/standard-integration/package.json @@ -8,7 +8,7 @@ "test": "echo \"Error: no test specified\" && exit 1", "start": "nodemon server/server.js", "format": "npx prettier --write **.{js,md}", - "format:check": "npx prettier --check **.{js,md}", + "format:check": "npx prettier --debug-check --check **.{js,md}", "lint": "npx eslint server/*.js --env=node && npx eslint client/*.js --env=browser" }, "license": "Apache-2.0", From 17eaa7c2addf7caca189330a05f8be95da02bf9a Mon Sep 17 00:00:00 2001 From: Greg Jopa <534034+gregjopa@users.noreply.github.com> Date: Tue, 22 Aug 2023 12:22:15 -0500 Subject: [PATCH 05/10] more debugging --- .github/workflows/validate.yml | 1 + standard-integration/package.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 0c299ad6..993c940e 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -24,6 +24,7 @@ jobs: directory=$(dirname "$file") cd "$directory" echo "$PWD" + ls -l npm run format:check && cd - done diff --git a/standard-integration/package.json b/standard-integration/package.json index 7792e51c..e601632f 100644 --- a/standard-integration/package.json +++ b/standard-integration/package.json @@ -8,7 +8,7 @@ "test": "echo \"Error: no test specified\" && exit 1", "start": "nodemon server/server.js", "format": "npx prettier --write **.{js,md}", - "format:check": "npx prettier --debug-check --check **.{js,md}", + "format:check": "npx prettier --log-level=debug --check **.{js,md}", "lint": "npx eslint server/*.js --env=node && npx eslint client/*.js --env=browser" }, "license": "Apache-2.0", From 5e457f43d15aa027713cd0b4820ffd905c0fb212 Mon Sep 17 00:00:00 2001 From: Greg Jopa <534034+gregjopa@users.noreply.github.com> Date: Tue, 22 Aug 2023 12:25:32 -0500 Subject: [PATCH 06/10] change glob pattern --- standard-integration/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/standard-integration/package.json b/standard-integration/package.json index e601632f..73ba9e2a 100644 --- a/standard-integration/package.json +++ b/standard-integration/package.json @@ -7,8 +7,8 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "nodemon server/server.js", - "format": "npx prettier --write **.{js,md}", - "format:check": "npx prettier --log-level=debug --check **.{js,md}", + "format": "npx prettier --write **/*.{js,md}", + "format:check": "npx prettier --log-level=debug --check **/*.{js,md}", "lint": "npx eslint server/*.js --env=node && npx eslint client/*.js --env=browser" }, "license": "Apache-2.0", From 89aa6aa434c85a78a196cfadeb90eebd1cfdee90 Mon Sep 17 00:00:00 2001 From: Greg Jopa <534034+gregjopa@users.noreply.github.com> Date: Tue, 22 Aug 2023 12:40:03 -0500 Subject: [PATCH 07/10] Clean up --- standard-integration/package.json | 2 +- test.sh | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 test.sh diff --git a/standard-integration/package.json b/standard-integration/package.json index 73ba9e2a..5413d87e 100644 --- a/standard-integration/package.json +++ b/standard-integration/package.json @@ -8,7 +8,7 @@ "test": "echo \"Error: no test specified\" && exit 1", "start": "nodemon server/server.js", "format": "npx prettier --write **/*.{js,md}", - "format:check": "npx prettier --log-level=debug --check **/*.{js,md}", + "format:check": "npx prettier --check **/*.{js,md}", "lint": "npx eslint server/*.js --env=node && npx eslint client/*.js --env=browser" }, "license": "Apache-2.0", diff --git a/test.sh b/test.sh deleted file mode 100644 index 910134b0..00000000 --- a/test.sh +++ /dev/null @@ -1,6 +0,0 @@ -find . -name package.json -maxdepth 2 -type f | while read -r file; do - directory=$(dirname "$file") - cd "$directory" - echo "$PWD" - npm run format:check && cd - -done \ No newline at end of file From e0f66f5ddc75c60551d860c94f263ce2092fc7c3 Mon Sep 17 00:00:00 2001 From: Greg Jopa <534034+gregjopa@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:01:49 -0500 Subject: [PATCH 08/10] revert CI changes --- .github/workflows/validate.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index 993c940e..ba842418 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -12,6 +12,8 @@ jobs: steps: - name: ⬇️ Checkout repo uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: ⎔ Setup node uses: actions/setup-node@v3 @@ -22,10 +24,7 @@ jobs: run: > find . -name package.json -maxdepth 2 -type f | while read -r file; do directory=$(dirname "$file") - cd "$directory" - echo "$PWD" - ls -l - npm run format:check && cd - + cd "$directory" && npm run format:check && cd - done - name: 👕 Lint code with ESLint From d31b3f4699bb8f63c20b11a3fb8ef1b21502a0f5 Mon Sep 17 00:00:00 2001 From: Greg Jopa <534034+gregjopa@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:02:43 -0500 Subject: [PATCH 09/10] make same changes for glob in advanced integration --- advanced-integration/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advanced-integration/package.json b/advanced-integration/package.json index c7211908..ff3f5b41 100644 --- a/advanced-integration/package.json +++ b/advanced-integration/package.json @@ -7,8 +7,8 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "start": "nodemon server/server.js", - "format": "npx prettier --write **.{js,md}", - "format:check": "npx prettier --check **.{js,md}", + "format": "npx prettier --write **/*.{js,md}", + "format:check": "npx prettier --check **/*.{js,md}", "lint": "npx eslint server/*.js --env=node && npx eslint client/*.js --env=browser" }, "license": "Apache-2.0", From 6800397d7f794f20edfc09897ec5889790eb0ac6 Mon Sep 17 00:00:00 2001 From: Greg Jopa <534034+gregjopa@users.noreply.github.com> Date: Tue, 22 Aug 2023 13:04:43 -0500 Subject: [PATCH 10/10] fix formatting --- standard-integration/client/app.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/standard-integration/client/app.js b/standard-integration/client/app.js index 50e8ee9f..cab942a0 100644 --- a/standard-integration/client/app.js +++ b/standard-integration/client/app.js @@ -36,7 +36,7 @@ window.paypal resultMessage(`Could not initiate PayPal Checkout...

${error}`); } }, - async onApprove (data, actions) { + async onApprove(data, actions) { try { const response = await fetch(`/api/orders/${data.orderID}/capture`, { method: "POST",