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
24 changes: 0 additions & 24 deletions .github/actions/setup-npm-demos-npm/action.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/actions/setup-npm-demos-react/action.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .github/actions/setup-npm/action.yml

This file was deleted.

31 changes: 31 additions & 0 deletions .github/actions/setup-pnpm-demos-npm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Setup demo pnpm"
description: "A composite action to setup pnpm for npm demo"

runs:
using: "composite"
steps:
- name: Get Node.js version
id: get-node-version
shell: bash
run: echo "node_version=$(grep node .tool-versions | cut -d' ' -f2)" >> $GITHUB_OUTPUT
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ steps.get-node-version.outputs.node_version }}
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061
with:
version: 10.11.0
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-npm-demo-${{ hashFiles('demos/npm/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm --prefix demos/npm install --frozen-lockfile
31 changes: 31 additions & 0 deletions .github/actions/setup-pnpm-demos-react/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Setup react demo pnpm"
description: "A composite action to setup pnpm for react demo"

runs:
using: "composite"
steps:
- name: Get Node.js version
id: get-node-version
shell: bash
run: echo "node_version=$(grep node .tool-versions | cut -d' ' -f2)" >> $GITHUB_OUTPUT
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ steps.get-node-version.outputs.node_version }}
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061
with:
version: 10.11.0
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-react-demo-${{ hashFiles('demos/react/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm --prefix demos/react install --frozen-lockfile
31 changes: 31 additions & 0 deletions .github/actions/setup-pnpm/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: "Setup pnpm"
description: "A composite action to setup pnpm"

runs:
using: "composite"
steps:
- name: Get Node.js version
id: get-node-version
shell: bash
run: echo "node_version=$(grep node .tool-versions | cut -d' ' -f2)" >> $GITHUB_OUTPUT
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ steps.get-node-version.outputs.node_version }}
- name: Install pnpm
uses: pnpm/action-setup@41ff72655975bd51cab0327fa583b6e92b6d3061
with:
version: 10.11.0
- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: ${{ runner.os }}-pnpm-store-
- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,16 @@ jobs:
- name: Patch version
run: ./scripts/patch-version.sh "${{ github.ref_name }}"

- name: Setup pnpm
uses: ./.github/actions/setup-pnpm

- name: Setup registry access
run: |
echo '@optable:registry=https://registry.npmjs.org/' > ~/.npmrc
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_CI_ACCESS_TOKEN }}" >> ~/.npmrc

- name: Publish to NPM
run: npm publish --access public
run: pnpm publish --access public --no-git-checks

deploy-sdk-to-gcs:
needs: [deploy-sdk-to-npm, define-gcs-versions-to-update]
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup npm
uses: ./.github/actions/setup-npm
- name: Setup pnpm
uses: ./.github/actions/setup-pnpm

- name: Patch build.json version
run: ./scripts/patch-version.sh "${{ inputs.version }}"

- name: Build web production
run: npm run build-web -- --mode=production
run: pnpm build-web --mode=production

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand All @@ -41,14 +41,14 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup npm
uses: ./.github/actions/setup-npm
- name: Setup pnpm
uses: ./.github/actions/setup-pnpm

- name: Patch build.json version
run: ./scripts/patch-version.sh "${{ inputs.version }}"

- name: Transpile lib
run: npm run build-lib
run: pnpm build-lib

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -99,14 +99,14 @@ jobs:
path: lib/dist

# SDK has a dependency on third-party js-sha256, we need to install node_modules in the root directory
- name: Setup npm
uses: ./.github/actions/setup-npm
- name: Setup pnpm
uses: ./.github/actions/setup-pnpm

- name: Setup npm react demo
uses: ./.github/actions/setup-npm-demos-react
- name: Setup pnpm react demo
uses: ./.github/actions/setup-pnpm-demos-react

- name: Build react demo
run: npm run build
run: pnpm run build

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand All @@ -124,11 +124,11 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup npm demos npm
uses: ./.github/actions/setup-npm-demos-npm
- name: Setup pnpm demos npm
uses: ./.github/actions/setup-pnpm-demos-npm

- name: Build npm-demo
run: npm run build
run: pnpm run build

- name: Upload artifacts
uses: actions/upload-artifact@v4
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/reusable-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ jobs:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup npm
uses: ./.github/actions/setup-npm
- name: Setup pnpm
uses: ./.github/actions/setup-pnpm

- name: Test
run: npm run test
run: pnpm test

prettier:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup npm
uses: ./.github/actions/setup-npm
- name: Setup pnpm
uses: ./.github/actions/setup-pnpm

- name: Run prettier
run: npm run format
run: pnpm format

- name: Check if prettier changed files
run: git diff --exit-code || (echo "ESLint fixed some files. Please commit the changes." && exit 1)
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ demos/**/*.html
!demos/react/src/index.html
!demos/index-nocookies.html
!demos/index.html

# pnpm
.pnpm-debug.log
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ lib/dist
# demos
demos
*.svg
prebid.js
prebid.js
pnpm-lock.yaml
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ nodejs 22.12.0
semver 3.3.0
mkcert 1.4.4
pre-commit 4.0.1
pnpm 10.11.0
16 changes: 8 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,22 @@

.PHONY: test-sdk
test: deps
npm run test
pnpm test

.PHONY: build-web
build-web: deps
npm run build-web -- --mode=production
pnpm build-web -- --mode=production

.PHONY: build-lib
build-lib: deps
npm run build-lib
pnpm build-lib

.PHONY: build
build: build-web build-lib

.PHONY: deps
deps:
npm ci
pnpm install --frozen-lockfile

export SDK_URI ?= https://localhost:8181/sdk.js
export DCN_HOST ?= ca.edge.optable.co
Expand Down Expand Up @@ -65,13 +65,13 @@ demo-html:

.PHONY: demo-react
demo-react: build-lib
npm --prefix demos/react ci
npm --prefix demos/react run build
pnpm --prefix demos/react install --frozen-lockfile
pnpm --prefix demos/react run build

.PHONY: demo-npm
demo-npm:
npm --prefix demos/npm ci
npm --prefix demos/npm run build
pnpm --prefix demos/npm install --frozen-lockfile
pnpm --prefix demos/npm run build

.PHONY: certs
certs:
Expand Down
Loading