Skip to content

Commit

Permalink
Move from Yarn to npm 7 workspaces (#910)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnyp authored Aug 19, 2021
1 parent e559307 commit cb4d748
Show file tree
Hide file tree
Showing 54 changed files with 33,049 additions and 10,983 deletions.
2 changes: 2 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,7 @@ module.exports = {
"unicorn/prefer-number-properties": 0,
"unicorn/no-useless-undefined": 0,
"unicorn/no-null": 0,
"unicorn/prefer-module": 0,
"unicorn/numeric-separators-style": 0, // Requires Node.js 12.8
},
};
14 changes: 7 additions & 7 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,16 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x, 14.x, 15.x]
node-version: [12.x, 14.x, 16.x]
steps:
- uses: actions/checkout@v2

- name: Cache
uses: actions/cache@v2
- uses: actions/cache@v2
with:
path: |
${{github.workspace}}/node_modules
${{github.workspace}}/*/node_modules
key: ${{ runner.os }}-${{ hashFiles('**/yarn.lock') }}
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
Expand All @@ -34,6 +33,7 @@ jobs:
sudo apt-get -y install prosody lua-bitop lua-sec
sudo service prosody stop
- run: npm install -g npm
- run: make
- run: make test-ci

Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@ server/prosody-modules/

npm-debug.log
lerna-debug.log
yarn-error.log

.eslintcache
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
4 changes: 4 additions & 0 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

make test
2 changes: 0 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
node_modules/
**/dist/*.js
bundle.js
package.json
.yarn/
server/prosody-modules/
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@

setup:
node packages/xmpp.js/script.js
yarn
npm install
./node_modules/.bin/lerna bootstrap
cd packages/xmpp.js/ && yarn run prepublish
cd packages/xmpp.js/ && npm run prepublish
node bundle.js

lint:
./node_modules/.bin/eslint --cache .

test:
cd packages/xmpp.js/ && yarn run prepublish
yarn
cd packages/xmpp.js/ && npm run prepublish
npm install
./node_modules/.bin/lerna bootstrap
node bundle.js
./node_modules/.bin/ava
make lint
make bundlesize

test-ci:
yarn
npm install
./node_modules/.bin/lerna bootstrap
./node_modules/.bin/ava
make lint
Expand Down Expand Up @@ -63,4 +63,4 @@ cert:
cd server && openssl req -new -x509 -days 365 -nodes -out "localhost.crt" -newkey rsa:2048 -keyout "localhost.key" -subj "/C=US/ST=Denial/L=Springfield/O=Dis/CN=localhost"

ncu:
ncu && yarn lerna exec ncu
ncu && npx lerna exec ncu
5 changes: 1 addition & 4 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
{
"version": "0.12.0",
"npmClient": "yarn",
"useWorkspaces": true,
"packages": [
"packages/*"
],
"packages": ["packages/*"],
"command": {
"publish": {
"ignoreChanges": [
Expand Down
Loading

0 comments on commit cb4d748

Please sign in to comment.