chore: migrate yarn -> npm

This commit is contained in:
Roman Hotsiy 2020-03-17 11:06:03 +02:00
parent 6fd6da0c37
commit a24142b3fa
No known key found for this signature in database
GPG Key ID: 5CB7B3ACABA57CB0
10 changed files with 17493 additions and 10981 deletions

View File

@ -9,4 +9,4 @@
!webpack.config.ts
!package.json
!yarn.lock
!package-lock.json

View File

@ -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 youve 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.

View File

@ -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
.gitignore vendored
View File

@ -34,4 +34,4 @@ cli/index.js
/coverage
.ghpages-tmp
stats.json
/package-lock.json
yarn.lock

View File

@ -2,7 +2,6 @@ language: node_js
node_js:
- '10'
cache:
yarn: true
directories:
- "~/.cache"
env:
@ -35,6 +34,6 @@ deploy:
tags: true
- provider: script
skip_cleanup: true
script: yarn deploy:demo
script: npm run deploy:demo
on:
tags: true

View File

@ -107,14 +107,14 @@ 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):
npm i redoc
or using [yarn](https://yarnpkg.com):
yarn add redoc
or using [npm](https://docs.npmjs.com/getting-started/what-is-npm):
npm install redoc --save
### 2. Reference redoc script in HTML
For **CDN**:
```html

View File

@ -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) {
@ -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;
}

View File

@ -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

17460
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

10946
yarn.lock

File diff suppressed because it is too large Load Diff