Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: change from yarn to pnpm #50

Merged
merged 5 commits into from
Apr 5, 2024
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
14 changes: 14 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": ["@fingerprintjs/eslint-config-dx-team"],
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}
]
}
}
12 changes: 8 additions & 4 deletions .github/workflows/akamai_property_cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,19 @@ jobs:
runs-on: ubuntu-20.04
name: Clear Redundant Akamai Properties
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: 'Install pnpm'
uses: pnpm/action-setup@129abb77bf5884e578fcaf1f37628e41622cc371
with:
version: 8
- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
- name: Install dependencies
run: yarn install
run: pnpm install
- name: Clear Redundant Properties from Akamai
run: yarn ts-node scripts/clearProperties.ts
run: pnpm ts-node scripts/clearProperties.ts
env:
AK_HOST: '${{secrets.AK_HOST}}'
AK_CLIENT_TOKEN: '${{secrets.AK_CLIENT_TOKEN}}'
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,17 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: 'Install pnpm'
uses: pnpm/action-setup@129abb77bf5884e578fcaf1f37628e41622cc371
with:
version: 8
- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
- name: Install dependencies
run: yarn install
run: pnpm install
- name: Extract Branch Name
id: extract-branch
run: |
Expand Down Expand Up @@ -51,7 +55,7 @@ jobs:
AK_GROUP_ID: '${{secrets.AK_GROUP_ID}}'
AK_CONTRACT_ID: '${{secrets.AK_CONTRACT_ID}}'
FPJS_CI_DOMAIN: '${{secrets.FPJS_CI_DOMAIN}}'
run: yarn ts-node scripts/checkPropertyCanBeCreated.ts
run: pnpm ts-node scripts/checkPropertyCanBeCreated.ts
- name: Create Akamai Property
if: steps.check-akamai-property.outcome == 'success'
id: create-akamai-property
Expand All @@ -64,9 +68,9 @@ jobs:
AK_GROUP_ID: '${{secrets.AK_GROUP_ID}}'
AK_CONTRACT_ID: '${{secrets.AK_CONTRACT_ID}}'
FPJS_CI_DOMAIN: '${{secrets.FPJS_CI_DOMAIN}}'
run: yarn ts-node scripts/createProperty.ts
run: pnpm ts-node scripts/createProperty.ts
- name: Build Patch Body
run: yarn build --type patchBody --proxy-secret ${{secrets.FPJS_PROXY_SECRET}} --integration-path worker --agent-path pxdownload --result-path pxresult
run: pnpm build --type patchBody --proxy-secret ${{secrets.FPJS_PROXY_SECRET}} --integration-path worker --agent-path pxdownload --result-path pxresult
- name: Deploy Akamai Rules
id: deploy-rules
env:
Expand All @@ -80,4 +84,4 @@ jobs:
FPJS_CI_DOMAIN: '${{secrets.FPJS_CI_DOMAIN}}'
TEST_EDGE_WORKER_ID: ${{secrets.TEST_EDGE_WORKER_ID}}
NOTIFY_EMAIL_ADDRESS: ${{secrets.NOTIFY_EMAIL_ADDRESS}}
run: yarn ts-node scripts/deployRules.ts
run: pnpm ts-node scripts/deployRules.ts
13 changes: 8 additions & 5 deletions .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,21 @@ jobs:
runs-on: ubuntu-20.04
name: Build & Deploy & Test e2e
steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v4
- name: 'Install pnpm'
uses: pnpm/action-setup@129abb77bf5884e578fcaf1f37628e41622cc371
with:
version: 8
- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
- name: Install dependencies
run: yarn install
run: pnpm install
- name: Install Playwright
run: npx playwright install
- name: Run test
run: yarn test:e2e
run: pnpm test:e2e
env:
TEST_DOMAIN: ${{secrets.TEST_DOMAIN}}
TEST_RESULT_DOMAIN: ${{secrets.TEST_RESULT_DOMAIN}}
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/e2eForPR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,25 @@ jobs:
needs: check-changed-files
if: needs['check-changed-files'].outputs.CANT_PASS_WITHOUT_TESTS == 'true'
steps:
- uses: actions/checkout@v3

- uses: actions/checkout@v4
- name: 'Install pnpm'
uses: pnpm/action-setup@129abb77bf5884e578fcaf1f37628e41622cc371
with:
version: 8
- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: '.node-version'
- name: Install dependencies
run: yarn install
run: pnpm install
- name: Install Playwright
run: npx playwright install
- name: Extract Branch Name
id: extract-branch
run: |
echo SUBDOMAIN=$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | perl -pe 's/[^a-zA-Z0-9]+/-/g and s/-+$//g' | tr '[:upper:]' '[:lower:]') >> $GITHUB_OUTPUT
- name: Run test
run: yarn test:e2e
run: pnpm test:e2e
env:
TEST_DOMAIN: 'https://${{steps.extract-branch.outputs.SUBDOMAIN}}.${{secrets.FPJS_CI_DOMAIN}}'
TEST_RESULT_DOMAIN: ${{secrets.TEST_RESULT_DOMAIN}}
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/reset-prerelease-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Reset Prerelease Branch
on:
workflow_dispatch:

jobs:
reset-feature-branch:
uses: fingerprintjs/dx-team-toolkit/.github/workflows/reset-prerelease-branch.yml@v1
with:
branch_name: 'test'
appId: ${{ vars.APP_ID }}
secrets:
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"@fingerprintjs/prettier-config-dx-team"
87 changes: 4 additions & 83 deletions .releaserc.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,93 +6,14 @@
[
"@semantic-release/commit-analyzer",
{
"releaseRules":[
{
"type":"build",
"scope":"deps",
"release":"patch"
},
{
"type":"docs",
"scope":"README",
"release":"patch"
}
]
"config": "@fingerprintjs/conventional-changelog-dx-team",
"releaseRules": "@fingerprintjs/conventional-changelog-dx-team/release-rules"
}
],
[
"@semantic-release/release-notes-generator",
{
"preset":"conventionalCommits",
"presetConfig":{
"types":[
{
"type":"feat",
"section":"Features"
},
{
"type":"feature",
"section":"Features"
},
{
"type":"fix",
"section":"Bug Fixes"
},
{
"type":"perf",
"section":"Performance Improvements"
},
{
"type":"revert",
"section":"Reverts"
},
{
"type":"docs",
"scope":"README",
"section":"Documentation"
},
{
"type":"build",
"scope":"deps",
"section":"Build System"
},
{
"type":"docs",
"section":"Documentation",
"hidden":true
},
{
"type":"style",
"section":"Styles",
"hidden":true
},
{
"type":"chore",
"section":"Miscellaneous Chores",
"hidden":true
},
{
"type":"refactor",
"section":"Code Refactoring",
"hidden":true
},
{
"type":"test",
"section":"Tests",
"hidden":true
},
{
"type":"build",
"section":"Build System",
"hidden":true
},
{
"type":"ci",
"section":"Continuous Integration",
"hidden":true
}
]
}
"config": "@fingerprintjs/conventional-changelog-dx-team"
}
],
"@semantic-release/changelog",
Expand All @@ -105,7 +26,7 @@
[
"@semantic-release/exec",
{
"prepareCmd":"yarn build --type all"
"prepareCmd":"pnpm build --type all"
}
],
[
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

## Working with code

We prefer using [yarn](https://yarnpkg.com/) for installing dependencies and running scripts.
We prefer using [pnpm](https://pnpm.io/) for installing dependencies and running scripts.


For proposing changes, use the standard [pull request approach](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request). It's recommended to discuss fixes or new functionality in the Issues, first.
Expand All @@ -12,7 +12,7 @@ For proposing changes, use the standard [pull request approach](https://docs.git


### How to build
* After cloning the repository, run `yarn install` to install dependencies.
* After cloning the repository, run `pnpm install` to install dependencies.

* To build property rules please see the `How to build property rules` section in [README.md](https://github.com/fingerprintjs/fingerprint-pro-akamai-proxy-integration#how-to-build-property-rules)

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ See the [Akamai proxy integration guide](https://dev.fingerprint.com/docs/akamai

If you prefer, you can clone this repository and build the property rules and variables locally.

1. Run `yarn install`.
2. Run `yarn build --type terraform`. It will generate the following files you can use in your Terraform configuration as described above.
1. Run `pnpm install`.
2. Run `pnpm build --type terraform`. It will generate the following files you can use in your Terraform configuration as described above.

- `dist/terraform/json/fingerprint.json`
- `dist/terraform/json/variables.json`
Expand All @@ -136,8 +136,8 @@ The JSON files are equivalent to the JSON files available in the [latest release
You can clone this repository and build the property rules locally into a single `body.json` file. You can then apply them as a patch update to your property configuration using Akamai [Property Manager API](https://techdocs.akamai.com/property-mgr/reference/api). This allows you to install the integration in an automated way even if you do not use Terraform.


1. Run `yarn install`.
2. Run `yarn build --type patchBody --integration-path YOUR_INTEGRATION_PATH_HERE --agent-path YOUR_AGENT_PATH_HERE --result-path YOUR_RESULT_PATH_HERE --proxy-secret YOUR_PROXY_SECRET_HERE`.
1. Run `pnpm install`.
2. Run `pnpm build --type patchBody --integration-path YOUR_INTEGRATION_PATH_HERE --agent-path YOUR_AGENT_PATH_HERE --result-path YOUR_RESULT_PATH_HERE --proxy-secret YOUR_PROXY_SECRET_HERE`.
* Use the same values you would use in [Step 2](#how-to-install-with-terraform) if you were installing with Terraform.
* The command generates a `dist/patch-body/body.json` file. This file includes all rules and property variables necessary for the integration.
3. Use the [Patch a property's rule tree](https://techdocs.akamai.com/property-mgr/reference/patch-property-version-rules) endpoint of the Akamai Property Manager API to apply the generated JSON to your Akamai property.
Expand Down
Loading
Loading