Skip to content

Commit

Permalink
Merge pull request #49 from lariat-js/change-name
Browse files Browse the repository at this point in the history
Rename package
  • Loading branch information
mskelton authored Dec 4, 2023
2 parents 2416337 + da87040 commit 2268ae0
Show file tree
Hide file tree
Showing 10 changed files with 3,006 additions and 1,793 deletions.
11 changes: 0 additions & 11 deletions .changeset/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions .changeset/config.json

This file was deleted.

6 changes: 0 additions & 6 deletions .github/PULL_REQUEST_TEMPLATE.md

This file was deleted.

25 changes: 10 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,18 @@ jobs:
name: test-artifacts
path: test-results
release:
runs-on: ubuntu-latest
needs: [lint, test]
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: write
issues: write
pull-requests: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: 18.x
cache: yarn
- run: yarn install --immutable
- name: Create release pull request or publish to npm
id: changesets
uses: changesets/action@v1
with:
publish: yarn release
- uses: mskelton/setup-yarn@v1
- name: Build
run: yarn build
- name: Release
run: yarn semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3 changes: 3 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"branches": ["main"]
}
187 changes: 5 additions & 182 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,183 +1,6 @@
# lariat
# Changelog

## 2.0.1

### Patch Changes

- 70ae342: Fix missing `dist` directory in published package

## 2.0.0

### Major Changes

- 5d56e2d: Update package to use `exports` to conditionally export ESM and
CommonJS bundles. ESM is preferred and the CommonJS bundles will be deprecated
eventually.

## 1.5.0

### Minor Changes

- ead94a5: Update to use `@playwright/test` as a peer dependency. This should
resolve the problem when updating Playwright versions of also having to update
`playwright-core`.

## 1.4.1

### Patch Changes

- 295ad31: Fix option types for `getByTestId`

## 1.4.0

### Minor Changes

- fe4006f: Add support for testing library methods such as `getByText`.

## 1.3.0

### Minor Changes

- d44a0fd: Add `has` option to `Collection.el()` to filter by text using the
`has` locator option introduced in Playwright 1.19.

## 1.2.0

### Minor Changes

- e7a7733: Add `hasText` option to `Collection.el()` to filter by text using the
`hasText` locator option introduced in Playwright 1.18.

### Patch Changes

- 7233236: Remove deprecated named `Collection` export.
- 862133d: Update dependencies to Playwright 1.18.

## 1.1.0

### Minor Changes

- e5ca566: Add support for
[frame locators](https://playwright.dev/docs/api/class-framelocator)! Refer to
the readme for more details about how to use frame locators in your
collections.

## 1.0.0

### Major Changes

- 7b71d4a: Release v1 of Lariat!

### Minor Changes

- 7b71d4a: Change `Collection` to a default export. A deprecated named export
still exists to make migration easier.

## 0.4.1

### Patch Changes

- 5efc2e3: Ensure that `this.frame` always returns a `Frame` rather than a
`Page | Frame` like it used to.

## 0.4.0

### Minor Changes

- 1be805b: Add `nth`, `first`, and `last` properties for nested collections
similar to the same methods that are available for locators.

```ts
class TodoPage extends Collection<Page> {
item = this.nest(TodoItem, '.todo-item')
}

const todoPage = new TodoPage(page)
const firstItem = todoPage.item.first()
```

### Patch Changes

- 1be805b: Remove unncessary re-export of the `Locator` type.

## 0.3.1

### Patch Changes

- 2dbbda4: Make `Collection.page` public and add docs.

## 0.3.0

### Minor Changes

- 30b884a: Allow accessing the page a collection is associated with.

## 0.2.0

### Minor Changes

- b638933: Rename `Collection.origin` to `Collection.frame` and ensure that a
frame is always returned. This is used internally by the `portal` option but
can continue to be used for nesting collections where the nested collection
should not be part of the parent collections locator chain.
- b638933: Make `Collection` generic to allow specifying an exact type for the
`root` property. By default the type of `root` will be `Locator`.

### Patch Changes

- b638933: Remove documentation showing how to manually set the `root` property
as an member variable. This may still work but is discouraged.
- b638933: Improve type safety of `Collection.nest`. Previously you could pass a
`string` or `Locator` as the nested collection root even if the nested
collection accepts a `Page` or `Frame` as the root.

## 0.1.1

### Patch Changes

- 288767a: Fix `Locator` type being imported from `@playwright/test` instead of
`playwright-core` like it should have been.

## 0.1.0

### Minor Changes

- 68879ea: Update Playwright dependency to version 1.14 which support locators.

## 0.0.7

### Patch Changes

- 9b43893: Add better documentation for `Collection.el()` and
`Collection.nest()`

## 0.0.6

### Patch Changes

- 97d9917: Use `main` field until better ecosystem support for `exports`.

## 0.0.5

### Patch Changes

- 0053132: Export `Locator` type from Playwright to fix inferred type errors.

## 0.0.4

### Patch Changes

- e68c5a7: Export more types from the package to fix portability error.
- e68c5a7: Add `portal` option for nested selectors. Subject to change.

## 0.0.3

### Patch Changes

- 3b7e7b58: Allow passing a handle as the root to nested collections.

## 0.0.2

### Patch Changes

- 75cb3c7: Use simplified collection thanks to locators.
The changelog is automatically updated using
[semantic-release](https://github.com/semantic-release/semantic-release). You
can see it on the
[releases page](https://github.com/lariat-js/playwright/releases).
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
# Lariat for Playwright

[![Build](https://github.com/lariat-js/playwright/actions/workflows/build.yml/badge.svg)](https://github.com/lariat-js/playwright/actions/workflows/build.yml)
[![npm](https://img.shields.io/npm/v/lariat)](https://www.npmjs.com/package/lariat)
[![changesets](https://img.shields.io/badge/maintained%20with-changesets-blue)](https://github.com/atlassian/changesets)
[![npm](https://img.shields.io/npm/v/@lariat/playwright)](https://www.npmjs.com/package/@lariat/playwright)

Page object framework for [Playwright](https://playwright.dev).

Expand All @@ -11,25 +10,25 @@ Page object framework for [Playwright](https://playwright.dev).
npm

```sh
npm install lariat
npm install @lariat/playwright
```

Yarn

```sh
yarn add lariat
yarn add @lariat/playwright
```

pnpm

```sh
pnpm add lariat
pnpm add @lariat/playwright
```

Bun

```sh
bun add lariat
bun add @lariat/playwright
```

## Basic Usage
Expand All @@ -43,7 +42,7 @@ To create your own collections, simply create a class which extends the
method which we will explore more in a moment.

```ts
import Collection from 'lariat'
import Collection from '@lariat/playwright'

class TodoPage extends Collection<Page> {
input = this.el('#todo-input')
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
{
"name": "lariat",
"version": "2.0.1",
"name": "@lariat/playwright",
"version": "0.0.0-semantically-released",
"description": "Page object framework for end-to-end testing in Playwright.",
"publishConfig": {
"access": "public"
},
"author": "Lariat Team",
"license": "ISC",
"packageManager": "yarn@3.2.1",
Expand Down Expand Up @@ -39,7 +42,6 @@
"devDependencies": {
"@babel/core": "^7.20.12",
"@babel/eslint-parser": "^7.19.1",
"@changesets/cli": "^2.26.0",
"@playwright/test": "^1.30.0",
"@typescript-eslint/eslint-plugin": "^5.49.0",
"@typescript-eslint/parser": "^5.49.0",
Expand All @@ -49,6 +51,7 @@
"eslint-plugin-sort": "^2.4.0",
"eslint-plugin-widen": "^1.0.0",
"prettier": "^2.8.3",
"semantic-release": "^22.0.8",
"tsup": "^6.5.0",
"typescript": "^4.9.4"
}
Expand Down
10 changes: 0 additions & 10 deletions scripts/release.sh

This file was deleted.

Loading

0 comments on commit 2268ae0

Please sign in to comment.