Skip to content

Commit

Permalink
Merge pull request #567 from javierbrea/release
Browse files Browse the repository at this point in the history
Use pnpm. Upgrade devDependencies
  • Loading branch information
javierbrea authored Dec 6, 2024
2 parents 2c65021 + df76fb9 commit 00ef904
Show file tree
Hide file tree
Showing 78 changed files with 17,757 additions and 99,874 deletions.
3 changes: 0 additions & 3 deletions .eslintignore

This file was deleted.

37 changes: 0 additions & 37 deletions .eslintrc.js

This file was deleted.

32 changes: 13 additions & 19 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,31 @@ jobs:
shell: bash
run: echo "branch=$(echo ${GITHUB_REF##*/})" >> $GITHUB_OUTPUT
id: extract-branch
- name: Use Node.js
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
- name: Cache node modules
uses: actions/cache@v4
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- name: Install dependencies
run: npm ci
run: pnpm install
- name: Check spelling
run: pnpm run cspell
- name: Lint
run: npm run lint
run: pnpm run lint
- name: Check types
run: npm run tsc
run: pnpm run tsc
- name: Test unit
run: npm run test:unit
run: pnpm run test:unit
- name: Test mutation
run: npm run test:mutation
run: pnpm run test:mutation
env:
BRANCH_NAME: ${{ steps.extract-branch.outputs.branch }}
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_TOKEN }}
- name: Test E2E
run: npm run test:e2e
run: pnpm run test:e2e
id: test-e2e
- name: Upload E2E tests screenshots
if: ${{ always() && steps.test-e2e.outcome == 'failure' }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/check-package-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get NPM version is new
- name: Get version is new
id: check
uses: EndBug/[email protected]
with:
Expand All @@ -22,7 +22,7 @@ jobs:
run: |
echo "Version not changed"
exit 1
- name: Get NPM version
- name: Get version
id: package-version
uses: martinbeentjes/[email protected]
- name: Check Changelog version
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/publish-to-github.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,29 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
node-version: '18.x'
version: 9
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
registry-url: 'https://npm.pkg.github.com'
# Defaults to the user or organization that owns the workflow file
scope: '@javierbrea'
- uses: MerthinTechnologies/edit-json-action@v1
- name: Change package name
uses: MerthinTechnologies/edit-json-action@v1
with:
filename: './package.json'
key: 'name'
value: '@javierbrea/cypress-localstorage-commands'
- run: npm ci
- run: npm publish
- name: Install dependencies
run: pnpm install
- name: Publish package
run: pnpm -r publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18 changes: 13 additions & 5 deletions .github/workflows/publish-to-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- name: Checkout
uses: actions/checkout@v4
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
node-version: '18.x'
version: 9
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: "22.x"
registry-url: 'https://registry.npmjs.org/'
- run: npm ci
- run: npm publish
- name: Install dependencies
run: pnpm install
- name: Publish package
run: pnpm -r publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 1 addition & 4 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint-staged
pnpm run lint-staged
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Fixed
### Removed

## [2.2.7] - 2024-12-06

### Added
* chore: Check spelling in build workflow

### Changed
* chore: Use Pnpm as package manager
* chore: Upgrade eslint configuration to v9
* chore: Update devDependencies

### Fixed
* docs: Fix typos in README

## [2.2.6] - 2024-05-17

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ Use `cy.saveLocalStorage()` to save a snapshot of current `localStorage` at the

#### Cookies button example

Next example shows how this package can be used to test a "cookies button" _(which theorically sets a flag into `localStorage` and can be clicked only once)_
Next example shows how this package can be used to test a "cookies button" _(which in theory sets a flag into `localStorage` and can be clicked only once)_

```js
describe("Accept cookies button", () => {
Expand Down
47 changes: 47 additions & 0 deletions cspell.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
const { resolve } = require("path");

const DICTIONARIES_BASE_PATH = resolve(__dirname, "cspell");

module.exports = {
// Version of the setting file. Always 0.2
version: "0.2",
// Paths to be ignored
ignorePaths: [
"**/node_modules/**",
".husky/**",
"**/pnpm-lock.yaml",
"**/cspell/*.txt",
"cspell.config.js",
"**/.gitignore",
"**/coverage/**",
"**/dist/**",
"test-e2e/app/build/**",
"test-e2e/*/cypress/integration/**",
"test-e2e/app/build/**",
"test-e2e/cypress-typescript/cypress/support/cypress-localstorage-commands/**",
"reports/**",
],
caseSensitive: false,
// Language - current active spelling language
language: "en",
// Dictionaries to be used
dictionaryDefinitions: [
{
name: "missing",
path: `${DICTIONARIES_BASE_PATH}/missing.txt`,
},
],
dictionaries: ["missing"],
languageSettings: [
{
// In markdown files
languageId: "markdown",
// Exclude code blocks from spell checking
ignoreRegExpList: ["/^\\s*```[\\s\\S]*?^\\s*```/gm"],
},
],
// The minimum length of a word before it is checked.
minWordLength: 4,
// cspell:disable-next-line FlagWords - list of words to be always considered incorrect. This is useful for offensive words and common spelling errors. For example "hte" should be "the"
flagWords: ["hte"],
};
9 changes: 9 additions & 0 deletions cspell/missing.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Brea
commonmark
coverallsapp
javierbrea
Merthin
prelint
sonarcloud
sonarsource
Uninen
Loading

0 comments on commit 00ef904

Please sign in to comment.