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
70 changes: 0 additions & 70 deletions .eslintrc.js

This file was deleted.

7 changes: 5 additions & 2 deletions .github/workflows/actions/get-core-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,18 @@ description: 'sets the node version & initializes core dependencies'
runs:
using: composite
steps:
- name: 🟢 Use pnpm Version from package.json
uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9

# this overrides previous versions of the node runtime that was set.
# jobs that need a different version of the Node runtime should explicitly
# set their node version after running this step
- name: 🟢 Use Node Version from Volta
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version-file: './package.json'
cache: 'npm'
cache: 'pnpm'

- name: 📦 Install Dependencies
run: npm ci
run: pnpm install --frozen-lockfile
shell: bash
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
uses: ./.github/workflows/actions/get-core-dependencies

- name: 🏗️ Stencil Playwright Build
run: npm run build
run: pnpm run build
shell: bash

- name: 📤 Upload Build Artifacts
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-production-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
uses: ./.github/workflows/actions/get-core-dependencies

- name: 🏷️ Bump the Version
run: npm version ${{ inputs.version }} --no-git-tag
run: pnpm version ${{ inputs.version }} --no-git-tag-version

- name: 📝 Log Generated Changes
run: git --no-pager diff
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint-and-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
uses: ./.github/workflows/actions/get-core-dependencies

- name: 📝 ESLint
run: npm run lint
run: pnpm run lint

- name: 📝 Prettier Check
run: npm run format.dry-run
run: pnpm run format.dry-run
shell: bash

- name: 📝 Spellcheck
run: npm run spellcheck
run: pnpm run spellcheck
shell: bash

15 changes: 7 additions & 8 deletions .github/workflows/publish-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
description: 'Node.js version to use when publishing.'
required: false
type: string
default: '20'
default: '24'
registry-url:
description: 'Registry URL used for npm publish.'
required: false
Expand Down Expand Up @@ -74,7 +74,7 @@ jobs:
# have been bumped by running the Production PR Creation workflow first.
#
# TODO(STENCIL-1221): Push git tags to GitHub, only on Prod releases
run: npm version --no-git-tag-version ${{ inputs.version }} --allow-same-version
run: pnpm version --no-git-tag-version ${{ inputs.version }} --allow-same-version
shell: bash

- name: 🔎 Get Version from package.json
Expand Down Expand Up @@ -104,7 +104,7 @@ jobs:
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add package.json package-lock.json
git add package.json pnpm-lock.yaml
# Only commit if there are changes
if ! git diff --staged --quiet; then
git commit -m "chore: bump version to ${{ steps.get-version.outputs.VERSION }}"
Expand Down Expand Up @@ -150,11 +150,10 @@ jobs:
fi
shell: bash

- name: 🔄 Ensure Latest npm
run: npm install -g npm@latest
shell: bash

- name: 🚀 Publish to NPM
run: npm publish --tag ${{ inputs.tag }} --provenance
# --no-git-checks: pnpm defaults to requiring the current branch to be named "master" and
# up to date with its remote before publishing. This repo's default branch is "main", and the
# commit/tag/push steps above already guarantee a clean, pushed working tree, so the check is redundant.
run: pnpm publish --tag ${{ inputs.tag }} --provenance --no-git-checks
shell: bash

10 changes: 9 additions & 1 deletion .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,21 @@ on:
jobs:
unit_test:
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [22, 24]
steps:
- name: 📥 Checkout Code
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0

- name: 🕸️ Get Core Dependencies
uses: ./.github/workflows/actions/get-core-dependencies

- name: 🟢 Use Node ${{ matrix.node-version }} for Tests
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: ${{ matrix.node-version }}

- name: 📤 Download Build Archive
uses: ./.github/workflows/actions/download-archive
with:
Expand All @@ -28,6 +36,6 @@ jobs:
filename: stencil-playwright-build.zip

- name: 🧪 Unit Tests
run: npm run test
run: pnpm run test
shell: bash

41 changes: 21 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,53 +45,54 @@ Please see our [Contributor Code of Conduct](https://github.com/ionic-team/stenc
1. Fork the repo.
2. Clone your fork.
3. Make a branch for your change.
4. Stencil Playwright uses [volta](https://volta.sh) to manage its npm and Node versions.
[Install it](https://docs.volta.sh/guide/getting-started) before proceeding.
1. There's no need to install a specific version of npm or Node right now, it shall be done automatically for you in
the next step
5. Run `npm ci`
4. Stencil Playwright uses [volta](https://volta.sh) to manage its Node version, and [pnpm](https://pnpm.io) as
its package manager. [Install volta](https://docs.volta.sh/guide/getting-started) before proceeding.
1. There's no need to install a specific version of Node right now, it shall be done automatically for you in
the next step. pnpm itself is resolved automatically via [Corepack](https://nodejs.org/api/corepack.html)
from the `packageManager` field in `package.json` (run `corepack enable` once if you haven't already).
5. Run `pnpm install`

### Updates

1. Unit test. Unit test. Unit test. Please take a look at how other unit tests are written, and you can't write too many tests.
2. If there is a `*.spec.ts` file located in the `test/` folder, update it to include a test for your change, if needed. If this file doesn't exist, please notify us.
3. First run `npm run build`. Then run `npm run test` or `npm run test.watch` to make sure all tests are working, regardless if a test was added.
3. First run `pnpm run build`. Then run `pnpm run test` to make sure all tests are working, regardless if a test was added.

### Testing Changes Against a Project Locally

#### Testing with `npm link`:
#### Testing with `pnpm link`:

Using `npm link` is beneficial to the development cycle in that consecutive builds of Stencil Playwright are immediately available in your project, without any additional `npm install` steps needed:
Using `pnpm link` is beneficial to the development cycle in that consecutive builds of Stencil Playwright are immediately available in your project, without any additional install steps needed:

1. In the directory of _Stencil Playwright_:
1. Run `npm run build`
2. Run `npm link`
1. Run `pnpm run build`
2. Run `pnpm link --global`
2. In the directory of _your stencil project_:
1. Run `npm link @stencil/playwright`
1. Run `pnpm link --global @stencil/playwright`

You can then test your changes against your own Stencil project.

Afterwards, to clean up:

1. In the directory of _your stencil project_:
1. Run `npm unlink @stencil/playwright`
2. In the directory of _Stencil Playwright_, run `npm unlink`
1. Run `pnpm unlink @stencil/playwright`
2. In the directory of _Stencil Playwright_, run `pnpm unlink --global`

#### Testing with `npm pack`:
#### Testing with `pnpm pack`:

There are some cases where `npm link` may fall short. For instance, when upgrading a minimum/recommended package version where the package in question has changed its typings. Rather than updating `paths` in your project's `tsconfig.json` file, it may be easier to create a tarball of the project and install in manually.
There are some cases where `pnpm link` may fall short. For instance, when upgrading a minimum/recommended package version where the package in question has changed its typings. Rather than updating `paths` in your project's `tsconfig.json` file, it may be easier to create a tarball of the project and install in manually.

1. In the directory of _Stencil Playwright_:
1. Run `npm run build`
2. Run `npm pack`. This will create a tarball with the name `stencil-playwright-<VERSION>.tgz`
1. Run `pnpm run build`
2. Run `pnpm pack`. This will create a tarball with the name `stencil-playwright-<VERSION>.tgz`
2. In the directory of _your stencil project_:
1. Run `npm install --save-dev <PATH_TO_STENCIL_PLAYWRIGHT_REPO_ON_DISK>/stencil-playwright-<VERSION>.tgz`.
1. Run `pnpm add --save-dev <PATH_TO_STENCIL_PLAYWRIGHT_REPO_ON_DISK>/stencil-playwright-<VERSION>.tgz`.

Note that this method of testing is far more laborious than using `npm link`, and requires every step to be repeated following a change to the Stencil core source.
Note that this method of testing is far more laborious than using `pnpm link`, and requires every step to be repeated following a change to the Stencil core source.

Afterwards, to clean up:

1. In the directory of your Stencil project, run `npm install --save-dev @stencil/playwright@<VERSION>` for the `<VERSION>` of Stencil core that was installed in your project prior to testing.
1. In the directory of your Stencil project, run `pnpm add --save-dev @stencil/playwright@<VERSION>` for the `<VERSION>` of Stencil core that was installed in your project prior to testing.

### Commit Message Format

Expand Down
Loading
Loading