Skip to content

Commit a007660

Browse files
committed
use npm instead of yarn
1 parent 4de87bf commit a007660

File tree

7 files changed

+17767
-8928
lines changed

7 files changed

+17767
-8928
lines changed

.github/workflows/test-and-publish.yml

+12-16
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ jobs:
6161
uses: actions/setup-node@v3
6262
with:
6363
node-version: ${{ matrix.node-version }}
64-
cache: 'yarn'
64+
cache: 'npm'
6565
- name: Log environment setup
6666
run: |
6767
node -v
68-
yarn -v
68+
npm -v
6969
- name: Install dependencies
70-
run: yarn install --ignore-engines
70+
run: npm install
7171
- name: Build templates
72-
run: yarn run build:templates
72+
run: npm run build:templates
7373
- name: Build library
74-
run: yarn run build
74+
run: npm run build
7575

7676
publish:
7777
runs-on: ubuntu-latest
@@ -97,12 +97,12 @@ jobs:
9797
repo-token: "${{ secrets.GITHUB_TOKEN }}"
9898
tag: "${{ env.version }}"
9999
- name: Install dependencies
100-
run: yarn
100+
run: npm install
101101
- uses: actions/setup-node@v3
102102
with:
103103
registry-url: 'https://registry.npmjs.org'
104104
node-version: '18.x'
105-
- name: Configure Yarn version
105+
- name: Configure NPM version
106106
env:
107107
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
108108
run: |
@@ -112,19 +112,17 @@ jobs:
112112
echo "registry=https://registry.npmjs.org/" >> .npmrc
113113
echo "access=public" >> .npmrc
114114
echo "save-exact=true" >> .npmrc
115-
yarn config set version-tag-prefix ""
116-
yarn config set version-git-message "Release version %s"
117115
- name: Version package
118116
run: |
119117
# Update version in packages to publish
120-
yarn version --non-interactive --new-version $(cat .version)
118+
npm version $(cat .version) -m "Release version %s"
121119
- name: Publish to NPM
122-
run: yarn publish --tag $(cat .tag) --non-interactive --new-version $(cat .version)
120+
run: npm publish --tag $(cat .tag) diff2html@$(cat .version)
123121
- uses: actions/setup-node@v3
124122
with:
125123
node-version: '18.x'
126124
registry-url: 'https://npm.pkg.github.com'
127-
- name: Configure Yarn version
125+
- name: Configure NPM version
128126
env:
129127
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130128
run: |
@@ -134,18 +132,16 @@ jobs:
134132
echo "@rtfpessoa:registry=https://npm.pkg.github.com/" >> .npmrc
135133
echo "access=public" >> .npmrc
136134
echo "save-exact=true" >> .npmrc
137-
yarn config set version-tag-prefix ""
138-
yarn config set version-git-message "Release version %s"
139135
- name: Version package
140136
run: |
141137
# Update version in packages to publish
142-
yarn version --non-interactive --new-version $(cat .version)
138+
npm version $(cat .version) -m "Release version %s"
143139
- name: Publish to GPR
144140
run: |
145141
# HACK: Override npm package name to be able to publish in GitHub
146142
sed -i 's/^ "name":.*/ "name": "@rtfpessoa\/diff2html",/g' package.json
147143
echo "Going to publish version $(cat .version) to GitHub"
148-
yarn publish --tag $(cat .tag) --non-interactive --new-version $(cat .version)
144+
npm publish --tag $(cat .tag) diff2html@$(cat .version)
149145
# HACK: Restore npm package name
150146
sed -i 's/^ "name":.*/ "name": "diff2html",/g' package.json
151147
- name: Upload docs

.husky/pre-commit

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
npx lint-staged
4+
npm run lint:staged

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
- Before sending a pull request make sure your code is tested.
1212

13-
- Before sending a pull request for a feature, be sure to run tests with `yarn test`.
13+
- Before sending a pull request for a feature, be sure to run tests with `npm run test`.
1414

15-
- Use the same coding style as the rest of the codebase, most of the check can be performed with `yarn run lint`.
15+
- Use the same coding style as the rest of the codebase, most of the check can be performed with `npm run run lint`.
1616

1717
- Use `git rebase` (not `git merge`) to sync your work from time to time with the master branch.
1818

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ import { Controller } from '@hotwired/stimulus';
321321

322322
import { Diff2HtmlUI, Diff2HtmlUIConfig } from 'diff2html/lib/ui/js/diff2html-ui-slim.js';
323323

324-
// Requires `yarn add highlight.js`
324+
// Requires `npm install highlight.js`
325325
import 'highlight.js/styles/github.css';
326326
import 'diff2html/bundles/css/diff2html.min.css';
327327

0 commit comments

Comments
 (0)