Skip to content
This repository has been archived by the owner on Nov 8, 2022. It is now read-only.

Commit

Permalink
build: Use PNPM instead of NPM
Browse files Browse the repository at this point in the history
  • Loading branch information
ardalanamini committed Oct 29, 2022
1 parent 3fb2194 commit 333085d
Show file tree
Hide file tree
Showing 6 changed files with 3,048 additions and 8,205 deletions.
27 changes: 19 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,20 +64,25 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use PNPM
uses: pnpm/action-setup@v2
with:
version: 7

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
cache: npm
cache: pnpm
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org/

- name: Install dependencies
run: npm ci --no-fund
run: pnpm i

- run: npm run build:hybrid
- run: pnpm build:hybrid

- name: Publish the package
run: npm publish --tag ${{ needs.release.outputs.release-id }}
run: pnpm publish --tag ${{ needs.release.outputs.release-id }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

Expand All @@ -104,21 +109,27 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Use PNPM
uses: pnpm/action-setup@v2
with:
version: 7

- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
with:
cache: pnpm
node-version: ${{ env.NODE_VERSION }}
registry-url: https://npm.pkg.github.com/
scope: '@foxifyjs'

- run: sed -i 's/@foxify\/config/@foxifyjs\/config/g' package.json package-lock.json
- run: sed -i 's/@foxify\/config/@foxifyjs\/config/g' package.json

- name: Install dependencies
run: npm ci --no-fund
run: pnpm i

- run: npm run build:hybrid
- run: pnpm build:hybrid

- name: Publish the package
run: npm publish --tag ${{ needs.release.outputs.release-id }}
run: pnpm publish --tag ${{ needs.release.outputs.release-id }}
env:
NODE_AUTH_TOKEN: ${{ github.token }}
24 changes: 9 additions & 15 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,41 +30,35 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Setup up node modules cache
id: node-modules-cache
uses: actions/cache@v3
- name: Use PNPM
uses: pnpm/action-setup@v2
with:
path: '**/node_modules'
restore-keys: |
node-modules-cache-${{ runner.os }}-${{ runner.arch }}-${{ matrix.node-version }}-
node-modules-cache-${{ runner.os }}-${{ runner.arch }}-
key: node-modules-cache-${{ runner.os }}-${{ runner.arch }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
version: 7

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
cache: npm
cache: pnpm
node-version: ${{ matrix.node-version }}

- name: Install dependencies
if: ${{ steps.node-modules-cache.outputs.cache-hit != 'true' }}
run: npm i --no-fund
run: pnpm i

- name: Check code styles
run: npm run lint
run: pnpm lint

- name: Build CommonJS
run: npm run build
run: pnpm build

- name: Build ECMAScript
run: npm run build:esm
run: pnpm build:esm

- name: Get number of CPU cores
id: cpu-cores
uses: SimenB/github-actions-cpu-cores@v1

- name: Test the project
run: npm run test:ci -- --maxWorkers ${{ steps.cpu-cores.outputs.count }}
run: pnpm test:ci --maxWorkers ${{ steps.cpu-cores.outputs.count }}

- name: Upload coverage to CodeCov
uses: codecov/codecov-action@v3
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ Foxify Configuration
## Table of Content

- [Installation](#installation)
- [NPM](#npm)
- [PNPM](#pnpm)
- [Yarn](#yarn)
- [Usage](#usage)
- [ECMAScript](#ecmascript)
- [CommonJS](#commonjs)
Expand All @@ -17,10 +20,27 @@ Foxify Configuration

## Installation

> In case of using GitHub package registry,
> the package name will be `@foxifyjs/config`.
### NPM

```shell
npm i @foxify/config
```

### PNPM

```shell
pnpm add @foxify/config
```

### Yarn

```shell
yarn add @foxify/config
```

## Usage

Create the `foxify.config.js` file at the root of your project. (Optional)
Expand Down
Loading

0 comments on commit 333085d

Please sign in to comment.