Skip to content

Commit

Permalink
build: remove yarn as package manager, revert to npm
Browse files Browse the repository at this point in the history
  • Loading branch information
Frazer Smith committed Jan 17, 2021
1 parent 8328e9b commit 536b7c2
Show file tree
Hide file tree
Showing 8 changed files with 9,225 additions and 5,909 deletions.
2 changes: 1 addition & 1 deletion .github/.typo-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dictionaries:
excluded_files:
- ".github/.typo-ci.yml"
- "node_modules/**/*"
- "yarn.lock"
- "package-lock.json"

# Any typos we should ignore?
excluded_words:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
with:
node-version: 14.x
registry-url: https://registry.npmjs.org/
- run: yarn --frozen-lockfile
- run: npm ci --ignore-scripts
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42 changes: 22 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,25 @@ jobs:
- uses: actions/setup-node@v2
with:
node-version: 14.x
- name: Get Yarn Cache Directory Path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
id: yarn-cache
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
-yarn-
${{ runner.os }}-node-
- name: Install
run: yarn --frozen-lockfile
run: npm ci --ignore-scripts
- name: Run ESLint
run: yarn lint
run: npm run lint
- name: Run Prettier
run: yarn lint:prettier:ci
run: npm run lint:prettier:ci
- name: Compile TypeScript Definition File
run: yarn tsc
run: npm run tsc

unit-tests:
name: Unit Tests
Expand All @@ -53,26 +54,27 @@ jobs:
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Get Yarn Cache Directory Path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
- name: Get npm cache directory
id: npm-cache-dir
run: |
echo "::set-output name=dir::$(npm config get cache)"
- uses: actions/cache@v2
id: yarn-cache
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
-yarn-
${{ runner.os }}-node-
- name: Install
run: yarn --frozen-lockfile
run: npm ci --ignore-scripts
- name: Install macOS dependencies
if: matrix.os == 'macos-latest'
run: brew install poppler
- name: Install Ubuntu dependencies
if: matrix.os == 'ubuntu-20.04'
run: sudo apt-get -y install poppler-data poppler-utils
- name: Run Tests
run: yarn jest-coverage
run: npm run jest-coverage
- name: Coveralls Parallel
uses: coverallsapp/github-action@master
with:
Expand Down
18 changes: 9 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,34 @@ Other processes and specifications that are in use in this repository are:

## Getting Started

This repository requires that you have [Node.js](https://nodejs.org) and [Yarn](https://classic.yarnpkg.com) installed.
This repository requires that you have [Node.js](https://nodejs.org) installed.

With those in place, you can fork the repository, clone it, and then run `yarn install` to install all development dependencies.
With those in place, you can fork the repository, clone it, and then run `npm install` to install all development dependencies.

### Development Workflow

After cloning and installing all the dependencies, there are several commands available for local development:

- `yarn lint` - Lints everything in src directory
- `yarn jest` - Runs Jest over all tests in src directory
- `yarn test` - Runs `yarn lint` and `yarn jest` together
- `npm run lint` - Lints everything in src directory
- `npm run jest` - Runs Jest over all tests in src directory
- `npm test` - Runs `npm run lint` and `npm run jest` together

## Pull Request Checklist

Prior to submitting a pull request back to the main repository, please make sure you have completed the following steps:

1. Pull request base branch is set to `master`. All pull requests should be forked from and merged back to `master`
2. Run `yarn test` to check the code adheres to the defined style and that it passes the Jest tests
3. Run `yarn lint:prettier` to run the Prettier code formatter over the code
2. Run `npm test` to check the code adheres to the defined style and that it passes the Jest tests
3. Run `npm run lint:prettier` to run the Prettier code formatter over the code

## Release process

When cutting a release, the following steps need to be performed:

1. Create a release branch with the convention `release/x.x.x`
2. `package.json` needs to have a version update based on the content being released, remembering to adhere to semantic versioning
3. Generate the API docs if any changes have been made with `yarn doc`
4. Generate the changelog with `yarn changelog`
3. Generate the API docs if any changes have been made with `npm run doc`
4. Generate the changelog with `npm run changelog`
5. Create a tag for the version; the naming convention is the version (vx.x.x)
6. Push the tag to the repository
7. Draft a release in the release tab with release notes, copying the notes from the changelog
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ The node-poppler module was created out of a need for a PDF-to-HTML conversion m

## Installation

Install using [`yarn`](https://yarnpkg.com/en/package/node-poppler):
Install using [`npm`](https://www.npmjs.com/package/node-poppler):

```bash
yarn add node-poppler
npm install node-poppler
```

Or [`npm`](https://www.npmjs.com/package/node-poppler):
Or [`yarn`](https://yarnpkg.com/en/package/node-poppler):

```bash
npm install node-poppler
yarn add node-poppler
```

node-poppler's test scripts use yarn commands.
node-poppler's test scripts use npm commands.

### Linux and macOS/Darwin support

Expand Down
Loading

0 comments on commit 536b7c2

Please sign in to comment.