Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: nodejs
on:
# run on push but only for the main branch
push:
branches:
- main
# run for every pull request
pull_request: {}
jobs:
main:
runs-on: ubuntu-latest
steps:
- name: ⬇️ Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: 🤝 Set Node version from .nvmrc
run: echo NVMRC=`cat .nvmrc` >> $GITHUB_ENV

- name: ⎔ Setup node
uses: actions/setup-node@v4
with:
node-version: ${{ env.NVMRC }}

- name: 📥 Download deps
run: >
find . -name package.json -maxdepth 10 -type f -not -path "*/node_modules/*" | while read -r file; do
directory=$(dirname "$file")
echo "::group:: $directory"
cd "$directory" && npm install && cd -
echo "::endgroup::"
done

- name: 🧹 Check code formatting with Prettier
run: >
find . -name package.json -maxdepth 10 -type f -not -path "*/node_modules/*" | while read -r file; do
directory=$(dirname "$file")
echo "::group:: $directory"
cd "$directory" && npm run format:check && cd -
echo "::endgroup::"
done

- name: 👕 Lint code with ESLint
run: >
find . -name package.json -maxdepth 10 -type f -not -path "*/node_modules/*" | while read -r file; do
directory=$(dirname "$file")
echo "::group:: $directory"
cd "$directory" && npm run lint && cd -
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While you're at it, would it be helpful to have these as pre-commit hooks as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea of adding them as precommit hooks too. Let's do that in a separate PR.

echo "::endgroup::"
done
4 changes: 3 additions & 1 deletion client/oneTimePayment/html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"build": "vite build",
"preview": "vite preview",
"start": "vite",
"format": "prettier . --write"
"format": "prettier . --write",
"format:check": "prettier . --check",
"lint": "echo \"eslint is not set up\""
},
"license": "Apache-2.0",
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"merchant-page": "vite --config vite-merchant-example.config.js",
"paypal-iframe": "vite --config vite-paypal-iframe.config.js",
"start": "concurrently \"npm run merchant-page\" \"npm run paypal-iframe\"",
"format": "prettier . --write"
"format": "prettier . --write",
"format:check": "prettier . --check",
"lint": "echo \"eslint is not set up\""
},
"license": "Apache-2.0",
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions client/oneTimePayment/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "eslint .",
"preview": "vite preview",
"format": "prettier . --write",
"format:check": "prettier . --check",
"typecheck": "tsc --build --noEmit"
},
"dependencies": {
Expand Down
4 changes: 3 additions & 1 deletion client/savePayment/html/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@
"build": "vite build",
"preview": "vite preview",
"start": "vite",
"format": "npx prettier . --write"
"format": "prettier . --write",
"format:check": "prettier . --check",
"lint": "echo \"eslint is not set up\""
},
"license": "Apache-2.0",
"devDependencies": {
Expand Down
30 changes: 15 additions & 15 deletions client/savePayment/html/src/index.html
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Save Payment Sample Integrations - PayPal Web SDK</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>

<head>
<meta charset="UTF-8" />
<title>Save Payment Sample Integrations - PayPal Web SDK</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
</head>

<body>
<h1>Save Payment Integrations</h1>

<ul>
<li>
<a href="/recommended/index.html">Recommended integration with PayPal button</a>
</li>
</ul>
</body>
<body>
<h1>Save Payment Integrations</h1>

<ul>
<li>
<a href="/recommended/index.html"
>Recommended integration with PayPal button</a
>
</li>
</ul>
</body>
</html>
46 changes: 24 additions & 22 deletions client/savePayment/html/src/recommended/index.html
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Save Payment - Recommended Integration - PayPal Web SDK</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
.buttons-container {
display: flex;
flex-direction: column;
gap: 12px;
}
</style>
</head>

<head>
<meta charset="UTF-8" />
<title>Save Payment - Recommended Integration - PayPal Web SDK</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style>
.buttons-container {
display: flex;
flex-direction: column;
gap: 12px;
}
</style>
</head>
<body>
<h1>Save Payment Recommended Integration</h1>

<body>
<h1>Save Payment Recommended Integration</h1>

<div class="buttons-container">
<paypal-button id="paypal-button" type="pay" hidden></paypal-button>
</div>
<script src="app.js"></script>

<script async src="https://www.sandbox.paypal.com/web-sdk/v6/core" onload="onPayPalLoaded()"></script>
</body>
<div class="buttons-container">
<paypal-button id="paypal-button" type="pay" hidden></paypal-button>
</div>
<script src="app.js"></script>

<script
async
src="https://www.sandbox.paypal.com/web-sdk/v6/core"
onload="onPayPalLoaded()"
></script>
</body>
</html>
2 changes: 2 additions & 0 deletions server/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
"check-node-version": "tsx src/checkNodeVersion.ts",
"clean": "rm -rf dist",
"format": "prettier . --write",
"format:check": "prettier . --check",
"lint": "echo \"eslint is not set up\"",
"start": "npm run check-node-version && tsx --watch src/server.ts",
"start-production": "NODE_ENV=production node dist/server.js"
},
Expand Down
Loading