Skip to content

Commit

Permalink
Use yarn (#24)
Browse files Browse the repository at this point in the history
* use yarn

* update contributing guide
  • Loading branch information
walaszczykm authored Jan 19, 2022
1 parent caa6a43 commit 825683e
Show file tree
Hide file tree
Showing 12 changed files with 13,504 additions and 46,774 deletions.
38 changes: 16 additions & 22 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,45 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
cache: 'npm'
cache-dependency-path: 'package-lock.json'
node-version: '16'
cache: 'yarn'
- name: Install dependecies
run: npm ci
run: yarn
- name: Run lint script
run: npm run lint
run: yarn lint
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
cache: 'npm'
cache-dependency-path: 'package-lock.json'
node-version: '16'
cache: 'yarn'
- name: Install dependecies
run: npm ci
run: yarn
- name: Run build script
run: npm run build
run: yarn build
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
cache: 'npm'
cache-dependency-path: 'package-lock.json'
node-version: '16'
cache: 'yarn'
- name: Install dependecies
run: npm ci
run: yarn
- name: Run test script
run: npm run test
run: yarn test
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
cache: 'npm'
cache-dependency-path: 'package-lock.json'

node-version: '16'
cache: 'yarn'
- name: Install dependecies
run: npm ci

run: yarn
- name: Start examples and run e2e tests
run: npm run e2e
run: yarn e2e
9 changes: 4 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16.x'
cache: 'npm'
cache-dependency-path: 'package-lock.json'
node-version: '16'
cache: 'yarn'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run publish
- run: yarn
- run: yarn run publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
20 changes: 10 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ We track public bugs in [GitHub Issues](https://github.com/livechat/chat-widget-

## Development Workflow

- Install the dependecies using `npm install`. This will also bootstrap a monorepo installing dependencies inside each package and linking them together.
- Install the dependecies using `yarn`. This will also bootstrap a monorepo installing dependencies inside each package and linking them together.

- Build the libraries using `npm run build` at the top level or inside single package.
- Build the libraries using `yarn build` at the top level or inside single package.

- Start watch mode for all of the adapters packages running `npm start packages`.
- Start watch mode for all of the adapters packages running `yarn start packages`.

- Start the example apps showcasing the usage of components for each framework using `npm start examples`.
- Start the example apps showcasing the usage of components for each framework using `yarn start examples`.

- Start watch mode for the given adapter with its example app running `npm start vue/react/angular`.
- Start watch mode for the given adapter with its example app running `yarn start vue/react/angular`.

## Versioning

This project uses [lerna](https://lerna.js.org/) to manage versions and publishing. It uses locked [semantic versioning](https://semver.org/) so each package has the same version at the time. You don't need and shouldn't manullay update touched packages versions. Changes will be published as soon as the next release will be rolled out. In order to properly update all packages to a new version checkout to `master` branch and run `npx lerna version`. It will ask about update type and if accepted update all packages and push tagged commit with changes in `package*.json` files.
This project uses [lerna](https://lerna.js.org/) to manage versions and publishing. It uses locked [semantic versioning](https://semver.org/) so each package has the same version at the time. You don't need and shouldn't manullay update touched packages versions. Changes will be published as soon as the next release will be rolled out. In order to properly update all packages to a new version checkout to `master` branch and run `yarn lerna version`. It will ask about update type and if accepted update all packages and push tagged commit with changes in `package*.json` files.

## Comitting

Expand Down Expand Up @@ -58,7 +58,7 @@ project
|
└─── e2e // set of e2e tests run on `examples`
|
└─── scripts // CLI commands used in root npm scripts
└─── scripts // CLI commands used in root package.json scripts
```

## Testing
Expand All @@ -73,15 +73,15 @@ In order to manually test introduced changes, use one of the example apps for th

Packages contain a suite of unit tests dedicated for their core functionalities. Whenever you make change or introduce some new functionality, please make sure that existing tests pass and that the coverage remains at the same level.

- To run tests use: `npm run test`
- To run tests use: `yarn test`
- Tests are located in: `packages/**/src/**/__tests__`
- In order to verify the current coverage use: `npm run test -- --coverage`
- In order to verify the current coverage use: `yarn test -- --coverage`

#### E2E tests

In order to make sure that the packages are all in sync and their core functionalities are working, we have created a suite of end-to-end tests based on the prepared `examples`. They simply navigate to the URL of each example in the repository and validate the Chat Widget presence and related data.

- To run tests use: `npm run e2e`
- To run tests use: `yarn e2e`
- Tests are located in: `e2e`

### Coverage
Expand Down
22 changes: 11 additions & 11 deletions examples/angular/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@
"start": "ng serve --port 3003"
},
"dependencies": {
"@angular/animations": "13.0.3",
"@angular/common": "13.0.3",
"@angular/compiler": "13.0.3",
"@angular/core": "13.0.3",
"@angular/forms": "13.0.3",
"@angular/platform-browser": "13.0.3",
"@angular/platform-browser-dynamic": "13.0.3",
"@angular/router": "13.0.3",
"@angular/animations": "13.1.2",
"@angular/common": "13.1.2",
"@angular/compiler": "13.1.2",
"@angular/core": "13.1.2",
"@angular/forms": "13.1.2",
"@angular/platform-browser": "13.1.2",
"@angular/platform-browser-dynamic": "13.1.2",
"@angular/router": "13.1.2",
"@livechat/widget-angular": "^1.0.0",
"rxjs": "7.4.0",
"tslib": "^2.3.0",
"zone.js": "0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "13.0.3",
"@angular/cli": "13.0.3",
"@angular/compiler-cli": "13.0.3",
"@angular-devkit/build-angular": "13.1.3",
"@angular/cli": "13.1.3",
"@angular/compiler-cli": "13.1.2",
"@types/node": "^12.11.1"
}
}
1 change: 1 addition & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"version": "1.0.0",
"useWorkspaces": true,
"npmClient": "yarn",
"command": {
"version": {
"allowBranch": "master"
Expand Down
Loading

0 comments on commit 825683e

Please sign in to comment.