mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-21 16:16:33 +03:00
chore: migrate yarn -> npm
This commit is contained in:
parent
6fd6da0c37
commit
a24142b3fa
|
@ -9,4 +9,4 @@
|
|||
!webpack.config.ts
|
||||
|
||||
!package.json
|
||||
!yarn.lock
|
||||
!package-lock.json
|
||||
|
|
32
.github/CONTRIBUTING.md
vendored
32
.github/CONTRIBUTING.md
vendored
|
@ -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.
|
||||
|
|
9
.github/workflows/unit-tests.yml
vendored
9
.github/workflows/unit-tests.yml
vendored
|
@ -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
2
.gitignore
vendored
|
@ -34,4 +34,4 @@ cli/index.js
|
|||
/coverage
|
||||
.ghpages-tmp
|
||||
stats.json
|
||||
/package-lock.json
|
||||
yarn.lock
|
||||
|
|
|
@ -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
|
||||
|
|
10
README.md
10
README.md
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -11,8 +11,8 @@ 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
17460
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user