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 !webpack.config.ts
!package.json !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: Before submitting a pull request, please make sure the following is done:
1. Fork the repository and create your branch from master. 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! 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. 4. Ensure the test suite passes (`npm test`). Tip: `npm test -- --watch TestName` is helpful in development.
5. Format your code with prettier (`yarn prettier`). 5. Format your code with prettier (`npm run prettier`).
## Development Setup ## 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: After cloning the repo, run:
```bash ```bash
$ yarn install # or npm $ npm install # or npm
``` ```
### Commonly used NPM scripts ### Commonly used NPM scripts
``` bash ``` bash
# dev-server, watch and auto reload playground # dev-server, watch and auto reload playground
$ yarn start $ npm start
# start playground app in production environment # start playground app in production environment
$ yarn start:prod $ npm run start:prod
# runt tslint # runt tslint
$ yarn lint $ npm run lint
# try autofix tslint issues # try autofix tslint issues
$ yarn lint --fix $ npm run lint -- --fix
# run unit tests # run unit tests
$ yarn unit $ npm run unit
# run e2e tests # run e2e tests
$ yarn e2e $ npm run e2e
# open cypress UI to debug e2e test # open cypress UI to debug e2e test
$ yarn cy:open $ npm run cy:open
# run the full test suite, include linting / unit / e2e # run the full test suite, include linting / unit / e2e
$ yarn test $ npm test
# prepare bundles # prepare bundles
$ yarn bundle $ npm run bundle
# format the code using prettier # format the code using prettier
$ yarn prettier $ npm run prettier
# auto-generate changelog # auto-generate changelog
$ yarn changelog $ npm run changelog
``` ```
There are some other scripts available in the `scripts` section of the `package.json` file. 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 uses: actions/setup-node@v1
with: with:
node-version: 10.x node-version: 10.x
- name: yarn install, build, and test - name: npm install, build, and test
run: | run: |
npm install -g yarn npm install
yarn install npm run bundle
yarn bundle npm test
yarn test

2
.gitignore vendored
View File

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

View File

@ -2,7 +2,6 @@ language: node_js
node_js: node_js:
- '10' - '10'
cache: cache:
yarn: true
directories: directories:
- "~/.cache" - "~/.cache"
env: env:
@ -35,6 +34,6 @@ deploy:
tags: true tags: true
- provider: script - provider: script
skip_cleanup: true skip_cleanup: true
script: yarn deploy:demo script: npm run deploy:demo
on: on:
tags: true 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. **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) ### 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 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 ### 2. Reference redoc script in HTML
For **CDN**: For **CDN**:
```html ```html

View File

@ -17,7 +17,7 @@ const localDistDir = './benchmark/revisions/local/bundles';
sh.rm('-rf', localDistDir); sh.rm('-rf', localDistDir);
console.log(`Building local dist: ${localDistDir}`); console.log(`Building local dist: ${localDistDir}`);
sh.mkdir('-p', localDistDir); sh.mkdir('-p', localDistDir);
exec(`yarn bundle:lib --output-path ${localDistDir}`); exec(`npm run bundle:lib --output-path ${localDistDir}`);
const revisions = []; const revisions = [];
for (const arg of args) { for (const arg of args) {
@ -119,7 +119,7 @@ function buildRevisionDist(revision) {
const pwd = sh.pwd(); const pwd = sh.pwd();
sh.cd(buildDir); 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); sh.cd(pwd);
return distDir; return distDir;
} }

View File

@ -7,12 +7,12 @@
FROM node:alpine FROM node:alpine
RUN apk update && apk add --no-cache git RUN apk update && apk add --no-cache git
# Install dependencies # Install dependencies
WORKDIR /build WORKDIR /build
COPY package.json yarn.lock /build/ COPY package.json package-lock.json /build/
RUN yarn install --frozen-lockfile --ignore-optional --ignore-scripts RUN npm ci --no-optional --ignore-scripts
# copy only required for the build files # copy only required for the build files
COPY src /build/src 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