Skip to content

Commit

Permalink
Merge branch 'main' into mxdvl/constants
Browse files Browse the repository at this point in the history
  • Loading branch information
mxdvl authored Nov 1, 2021
2 parents 42e53e8 + 81e60af commit eff96ab
Show file tree
Hide file tree
Showing 16 changed files with 6,898 additions and 7,372 deletions.
63 changes: 54 additions & 9 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,20 @@ jobs:
- name: Setup node
uses: guardian/actions-setup-node@main

- name: Cache .pnpm-store
uses: actions/[email protected]
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Install pnpm
run: curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@6

- name: Install dependencies
uses: bahmutov/npm-install@v1
run: pnpm install

- name: Run unit tests
run: 'yarn test --coverage --ci'
run: pnpm test:ci

- name: Report coverage
uses: coverallsapp/github-action@master
Expand All @@ -48,11 +57,20 @@ jobs:
- name: Setup node
uses: guardian/actions-setup-node@main

- name: Cache .pnpm-store
uses: actions/[email protected]
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Install pnpm
run: curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@6

- name: Install dependencies
uses: bahmutov/npm-install@v1
run: pnpm install

- name: Lint files
run: yarn lint
run: pnpm lint
types:
name: Types
needs: [docs]
Expand All @@ -64,11 +82,20 @@ jobs:
- name: Setup node
uses: guardian/actions-setup-node@main

- name: Cache .pnpm-store
uses: actions/[email protected]
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Install pnpm
run: curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@6

- name: Install dependencies
uses: bahmutov/npm-install@v1
run: pnpm install

- name: Check types
run: yarn tsc
run: pnpm tsc
build:
name: Build
needs: [docs]
Expand All @@ -82,11 +109,20 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}

- name: Cache .pnpm-store
uses: actions/[email protected]
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Install pnpm
run: curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@6

- name: Install dependencies
uses: bahmutov/npm-install@v1
run: pnpm install

- name: Build package
run: yarn build
run: pnpm build

- name: Save build
if: github.ref == 'refs/heads/main'
Expand All @@ -109,8 +145,17 @@ jobs:
- name: Setup node
uses: guardian/actions-setup-node@main

- name: Cache .pnpm-store
uses: actions/[email protected]
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Install pnpm
run: curl -f https://get.pnpm.io/v6.16.js | node - add --global pnpm@6

- name: Install dependencies
uses: bahmutov/npm-install@v1
run: pnpm install

- name: Fetch build
uses: actions/download-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn npm-run-all 'precommit:*'
pnpm npm-run-all 'precommit:*'
2 changes: 1 addition & 1 deletion .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn npm-run-all 'prepush:*'
pnpm npm-run-all 'prepush:*'
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"source.organizeImports": false
},
"eslint.format.enable": true,
"eslint.packageManager": "yarn",
"eslint.packageManager": "pnpm",
"typescript.tsdk": "node_modules/typescript/lib",
"cSpell.words": [
"Prebid",
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
[![Generic badge](https://img.shields.io/badge/google-chat-259082.svg)](https://chat.google.com/room/AAAAPL2MBvE)

```bash
yarn add @guardian/commercial-core
pnpm add @guardian/commercial-core
```

or
Expand All @@ -43,8 +43,11 @@ If your target environment does not support that, make sure you transpile this p

### Requirements

1. [Node 14](https://nodejs.org/en/download/) ([nvm](https://github.com/nvm-sh/nvm) or [fnm](https://github.com/Schniz/fnm) recommended)
2. [Yarn](https://classic.yarnpkg.com/en/docs/install/)
1. [Node 14](https://nodejs.org/en/download/) ([nvm][] or [fnm][] recommended)
2. [PNPM](https://pnpm.io/installation)

[nvm]: https://github.com/nvm-sh/nvm
[fnm]: https://github.com/Schniz/fnm

### Releasing

Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
"compile:common": "tsc --project ./tsconfig.build.json --outDir ./dist/cjs --module CommonJS",
"compile:esm": "tsc --project ./tsconfig.build.json --outDir ./dist/esm",
"lint": "eslint .",
"preinstall": "npx only-allow pnpm",
"precommit:lint": "lint-staged",
"prepush:test": "jest --verbose --runInBand --onlyChanged",
"test": "jest",
"test:ci": "jest --coverage --ci",
"tsc": "tsc --noEmit",
"validate": "npm-run-all tsc lint test build",
"prepare": "husky install"
Expand All @@ -42,6 +44,7 @@
"devDependencies": {
"@commitlint/cli": "^13",
"@commitlint/config-conventional": "^13",
"@guardian/consent-management-platform": "^8",
"@guardian/eslint-config-typescript": "^0.7",
"@guardian/libs": "^3",
"@guardian/prettier": "^0.7",
Expand Down
Loading

0 comments on commit eff96ab

Please sign in to comment.