Skip to content

Commit

Permalink
chore: migrate yarn -> npm
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanHotsiy committed Mar 17, 2020
1 parent 6fd6da0 commit a24142b
Show file tree
Hide file tree
Showing 10 changed files with 17,492 additions and 10,980 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@
!webpack.config.ts

!package.json
!yarn.lock
!package-lock.json
32 changes: 16 additions & 16 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,56 +15,56 @@ Hi! We're really excited that you are interested in contributing to ReDoc. Befor
Before submitting a pull request, please make sure the following is done:

1. Fork the repository and create your branch from master.
2. Run `yarn` in the repository root.
2. Run `npm install` in the repository root.
3. If you’ve fixed a bug or added code that should be tested, add tests!
4. Ensure the test suite passes (`yarn test`). Tip: `yarn test --watch TestName` is helpful in development.
5. Format your code with prettier (`yarn prettier`).
4. Ensure the test suite passes (`npm test`). Tip: `npm test -- --watch TestName` is helpful in development.
5. Format your code with prettier (`npm run prettier`).

## Development Setup

You will need [Node.js](http://nodejs.org) at `v8.0.0+` and [Yarn](https://yarnpkg.com/en/) at `v1.2.0+`
You will need [Node.js](http://nodejs.org) at `v12.0.0+`.

After cloning the repo, run:

```bash
$ yarn install # or npm
$ npm install # or npm
```

### Commonly used NPM scripts

``` bash
# dev-server, watch and auto reload playground
$ yarn start
$ npm start

# start playground app in production environment
$ yarn start:prod
$ npm run start:prod

# runt tslint
$ yarn lint
$ npm run lint

# try autofix tslint issues
$ yarn lint --fix
$ npm run lint -- --fix

# run unit tests
$ yarn unit
$ npm run unit

# run e2e tests
$ yarn e2e
$ npm run e2e

# open cypress UI to debug e2e test
$ yarn cy:open
$ npm run cy:open

# run the full test suite, include linting / unit / e2e
$ yarn test
$ npm test

# prepare bundles
$ yarn bundle
$ npm run bundle

# format the code using prettier
$ yarn prettier
$ npm run prettier

# auto-generate changelog
$ yarn changelog
$ npm run changelog
```

There are some other scripts available in the `scripts` section of the `package.json` file.
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ jobs:
uses: actions/setup-node@v1
with:
node-version: 10.x
- name: yarn install, build, and test
- name: npm install, build, and test
run: |
npm install -g yarn
yarn install
yarn bundle
yarn test
npm install
npm run bundle
npm test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ cli/index.js
/coverage
.ghpages-tmp
stats.json
/package-lock.json
yarn.lock
3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ language: node_js
node_js:
- '10'
cache:
yarn: true
directories:
- "~/.cache"
env:
Expand Down Expand Up @@ -35,6 +34,6 @@ deploy:
tags: true
- provider: script
skip_cleanup: true
script: yarn deploy:demo
script: npm run deploy:demo
on:
tags: true
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,13 @@ That's all folks!
**IMPORTANT NOTE:** if you work with untrusted user spec, use `untrusted-spec` [option](#redoc-options-object) to prevent XSS security risks.

### 1. Install ReDoc (skip this step for CDN)
Install using [yarn](https://yarnpkg.com):
Install using [npm](https://docs.npmjs.com/getting-started/what-is-npm):

yarn add redoc
npm i redoc

or using [npm](https://docs.npmjs.com/getting-started/what-is-npm):
or using [yarn](https://yarnpkg.com):

npm install redoc --save
yarn add redoc

### 2. Reference redoc script in HTML
For **CDN**:
Expand Down
4 changes: 2 additions & 2 deletions benchmark/benchmark.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const localDistDir = './benchmark/revisions/local/bundles';
sh.rm('-rf', localDistDir);
console.log(`Building local dist: ${localDistDir}`);
sh.mkdir('-p', localDistDir);
exec(`yarn bundle:lib --output-path ${localDistDir}`);
exec(`npm run bundle:lib --output-path ${localDistDir}`);

const revisions = [];
for (const arg of args) {
Expand Down Expand Up @@ -119,7 +119,7 @@ function buildRevisionDist(revision) {

const pwd = sh.pwd();
sh.cd(buildDir);
exec('yarn remove cypress puppeteer && yarn && yarn bundle:lib');
exec('npm uninstall cypress puppeteer && npm install && npm run bundle:lib');
sh.cd(pwd);
return distDir;
}
6 changes: 3 additions & 3 deletions config/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@

FROM node:alpine

RUN apk update && apk add --no-cache git
RUN apk update && apk add --no-cache git

# Install dependencies
WORKDIR /build
COPY package.json yarn.lock /build/
RUN yarn install --frozen-lockfile --ignore-optional --ignore-scripts
COPY package.json package-lock.json /build/
RUN npm ci --no-optional --ignore-scripts

# copy only required for the build files
COPY src /build/src
Expand Down
Loading

0 comments on commit a24142b

Please sign in to comment.