Skip to content

Commit

Permalink
chore: replace package manager from yarn to pnpm
Browse files Browse the repository at this point in the history
  • Loading branch information
2eha0 committed Aug 29, 2024
1 parent b1fa496 commit b7787cc
Show file tree
Hide file tree
Showing 14 changed files with 5,573 additions and 4,373 deletions.
7 changes: 0 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@
version: 2

registries:
yarn:
type: npm-registry
url: https://registry.yarnpkg.com
token: ${{secrets.NPM_TOKEN_PRIVATE_READ}}
replaces-base: true
npm:
type: npm-registry
url: https://registry.npmjs.org
Expand All @@ -22,7 +17,6 @@ updates:
directory: "/"
registries:
- npm
- yarn
schedule:
interval: "weekly"
day: "friday"
Expand All @@ -43,7 +37,6 @@ updates:
directory: "/tests/playwright"
registries:
- npm
- yarn
schedule:
interval: "weekly"
day: "friday"
Expand Down
18 changes: 10 additions & 8 deletions .github/workflows/.reusable_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,24 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2 # version is determined from the packageManager field in package.json by default.

- id: setup-node
name: Setup Node
timeout-minutes: 5
continue-on-error: true
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: pnpm

- name: Install dependency
timeout-minutes: 5
run: |
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
yarn install
run: pnpm install

- name: Run lint
timeout-minutes: 10
run: yarn lint
run: pnpm lint

build-assets:
name: Build assets
Expand All @@ -43,26 +44,27 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2 # version is determined from the packageManager field in package.json by default.

- id: setup-node
name: Setup Node
timeout-minutes: 5
continue-on-error: true
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: pnpm

- name: Install dependencies
timeout-minutes: 5
run: |
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
yarn install
run: pnpm install

- name: Build assets
timeout-minutes: 10
env:
NODE_OPTIONS: "--max-old-space-size=8192"
run: |
yarn build
pnpm build
echo "${{ github.sha }}" > dist/build.sha1
- name: Pack assets
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/.reusable_e2e_tests_ee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2 # version is determined from the packageManager field in package.json by default.

- name: Download assets
timeout-minutes: 5
uses: actions/download-artifact@v4
Expand All @@ -46,13 +48,13 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: pnpm

- name: Install Playwright
timeout-minutes: 10
run: |
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
yarn install:e2e
yarn playwright install chromium
pnpm install:e2e
pnpm playwright install chromium
- name: Log in to GitHub Container Registry
timeout-minutes: 1
Expand Down Expand Up @@ -92,7 +94,7 @@ jobs:
env:
KM_TEST_GUI_URL: ${{ inputs.base-url }}
run: |
yarn test:e2e \
pnpm test:e2e \
--pass-with-no-tests \
--retries ${{ inputs.retries }} \
--reporter=list \
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/.reusable_e2e_tests_oss.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ jobs:
- name: Checkout source code
uses: actions/checkout@v3

- uses: pnpm/action-setup@v2 # version is determined from the packageManager field in package.json by default.

- name: Download assets
timeout-minutes: 5
uses: actions/download-artifact@v4
Expand All @@ -62,13 +64,13 @@ jobs:
uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: pnpm

- name: Install Playwright
timeout-minutes: 10
run: |
npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
yarn install:e2e
yarn playwright install chromium
pnpm install:e2e
pnpm playwright install chromium
- name: Log in to GitHub Container Registry
timeout-minutes: 1
Expand Down Expand Up @@ -117,7 +119,7 @@ jobs:
env:
KM_TEST_GUI_URL: ${{ inputs.base-url }}
run: |
yarn test:e2e \
pnpm test:e2e \
--pass-with-no-tests \
--retries ${{ inputs.retries }} \
--reporter=list \
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 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
pnpm lint-staged
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
4 changes: 2 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ End-to-end testing, also called E2E testing, guarantees that applications perfor
Kong Manager uses Playwright to perform end-to-end tests. To install dependencies required for end-to-end testing, run the following command:

```shell
yarn install:e2e
pnpm install:e2e
```

Afterward, run all the test cases using the following command:

```shell
yarn test:e2e
pnpm test:e2e
```

You may find all the test cases for end-to-end testing under the `tests/playwright/specs` folder. Please feel free to make any necessary modifications and add new test cases as per your requirements. Happy testing!
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,14 @@ In addition, the plugin configuration UI provides instructions for each configur

## Contributing

Kong Manager OSS is written in JavaScript. It uses Vue for it's UI components, and `yarn` for managing dependencies. To build Kong Manager OSS locally please ensure that you have `node.js 18+` and `yarn` installed.
Kong Manager OSS is written in JavaScript. It uses Vue for it's UI components, and `pnpm` for managing dependencies. To build Kong Manager OSS locally please ensure that you have `node.js 18+` and `pnpm` installed.

You'll also need a running Kong Gateway instance. See [local testing](#local-testing) for a one-line solution. Alternatively, you can [build Kong Gateway from source](https://github.com/Kong/kong/tree/master/build).

Once Kong Gateway is running, run the following command to start the development server:

```bash
yarn && yarn serve
pnpm && pnpm serve
```

Kong Manager OSS is now available at http://localhost:8080
11 changes: 6 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"scripts": {
"serve": "vite",
"build": "vite build",
"install:e2e": "yarn --cwd tests/playwright install",
"test:e2e": "yarn --cwd tests/playwright run test",
"playwright": "yarn --cwd tests/playwright run playwright",
"install:e2e": "pnpm --dir tests/playwright install",
"test:e2e": "pnpm --dir tests/playwright run test",
"playwright": "pnpm --dir tests/playwright exec playwright",
"preview": "vite build && vite preview",
"lint": "yarn lint:eslint && yarn lint:vue && yarn lint:playwright && yarn lint:style",
"lint": "pnpm lint:eslint && pnpm lint:vue && pnpm lint:playwright && pnpm lint:style",
"lint:eslint": "eslint src tests/playwright",
"lint:eslint:fix": "eslint --fix src tests/playwright",
"lint:playwright": "tsc --noEmit --project tests/playwright/tsconfig.json --baseUrl tests/playwright",
Expand Down Expand Up @@ -86,5 +86,6 @@
"> 1%",
"last 2 versions",
"not IE <= 11"
]
],
"packageManager": "[email protected]"
}
Loading

0 comments on commit b7787cc

Please sign in to comment.