mirror of
https://github.com/Redocly/redoc.git
synced 2025-07-31 02:19:47 +03:00
DOP-3460: Use v1.0.0 of @dop/redoc for redoc-cli (#12)
This commit is contained in:
parent
a843a30489
commit
16bfcddb98
|
@ -70,8 +70,9 @@ Releasing the Redoc CLI can be done by:
|
|||
|
||||
1) Go to your local clone of the `mongodb-forks/redoc` repo and ensure you are on the latest iteration of the `main` branch.
|
||||
2) Go to the `cli/` directory.
|
||||
3) Run `npm install https://github.com/mongodb-forks/redoc.git#{VERSION_TAG}` to update the version of Redoc that the CLI uses.
|
||||
- Example: `npm install https://github.com/mongodb-forks/redoc.git#v1.0.0`. You should see the version set in the CLI's `package.json`.
|
||||
3) Run `npm install git+https://git@github.com/mongodb-forks/redoc#{VERSION_TAG}` to update the version of Redoc that the CLI uses.
|
||||
- Example: `npm install git+https://git@github.com/mongodb-forks/redoc#v1.0.0`. You should see the version set in the CLI's `package.json`.
|
||||
- The module should be installed through https. Otherwise, it may be installed via ssh, causing an error during the Autobuilder's image build.
|
||||
4) Run `npm version [major | minor | patch | prerelease --preid=rc]`.
|
||||
- A commit should have been pushed to a new `releases/@dop/redoc-cli@X.Y.Z` branch.
|
||||
- The creation of the new branch should create a new pull request.
|
||||
|
|
5
cli/.npmrc
Normal file
5
cli/.npmrc
Normal file
|
@ -0,0 +1,5 @@
|
|||
registry=https://artifactory.corp.mongodb.com/artifactory/api/npm/npm/
|
||||
_auth=${NPM_BASE_64_AUTH}
|
||||
_email=${NPM_EMAIL}
|
||||
_always-auth=true
|
||||
git-tag-version=false
|
20
cli/index.ts
20
cli/index.ts
|
@ -1,7 +1,6 @@
|
|||
#!/usr/bin/env node
|
||||
/* tslint:disable:no-implicit-dependencies */
|
||||
import * as React from 'react';
|
||||
import * as updateNotifier from 'update-notifier';
|
||||
import { renderToString } from 'react-dom/server';
|
||||
import { ServerStyleSheet } from 'styled-components';
|
||||
|
||||
|
@ -12,7 +11,7 @@ import { dirname, join, resolve, extname as getExtName } from 'path';
|
|||
import * as zlib from 'zlib';
|
||||
|
||||
// @ts-ignore
|
||||
import { createStore, loadAndBundleSpec, Redoc } from 'redoc';
|
||||
import { createStore, loadAndBundleSpec, Redoc } from '@dop/redoc';
|
||||
|
||||
import { watch } from 'chokidar';
|
||||
import {
|
||||
|
@ -64,7 +63,7 @@ export const mimeTypes = {
|
|||
'.wasm': 'application/wasm',
|
||||
};
|
||||
|
||||
const BUNDLES_DIR = dirname(require.resolve('redoc'));
|
||||
const BUNDLES_DIR = dirname(require.resolve('@dop/redoc'));
|
||||
|
||||
const builderForBuildCommand = yargs => {
|
||||
yargs.positional('spec', {
|
||||
|
@ -112,7 +111,6 @@ const handlerForBuildCommand = async (argv: any) => {
|
|||
};
|
||||
|
||||
try {
|
||||
notifyUpdateCliVersion();
|
||||
await bundle(argv.spec, config);
|
||||
} catch (e) {
|
||||
handleError(e);
|
||||
|
@ -176,7 +174,6 @@ YargsParser.command(
|
|||
};
|
||||
|
||||
try {
|
||||
notifyUpdateCliVersion();
|
||||
await serve(argv.host as string, argv.port as number, argv.spec as string, config);
|
||||
} catch (e) {
|
||||
handleError(e);
|
||||
|
@ -471,16 +468,3 @@ function getObjectOrJSON(options) {
|
|||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
function notifyUpdateCliVersion() {
|
||||
const pkg = require('./package.json');
|
||||
const notifier = updateNotifier({
|
||||
pkg,
|
||||
updateCheckInterval: 0,
|
||||
shouldNotifyInNpmScript: true,
|
||||
});
|
||||
notifier.notify({
|
||||
message:
|
||||
'Run `{updateCommand}` to update.\nChangelog: https://github.com/Redocly/redoc/releases/tag/{latestVersion}',
|
||||
});
|
||||
}
|
||||
|
|
4907
cli/npm-shrinkwrap.json
generated
4907
cli/npm-shrinkwrap.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -14,6 +14,7 @@
|
|||
"postversion": "git push upstream releases/@dop/redoc-cli@$npm_package_version && git checkout - && git branch -D releases/@dop/redoc-cli@$npm_package_version"
|
||||
},
|
||||
"dependencies": {
|
||||
"@dop/redoc": "git+https://git@github.com/mongodb-forks/redoc.git#v1.0.0",
|
||||
"chokidar": "^3.5.1",
|
||||
"handlebars": "^4.7.7",
|
||||
"isarray": "^2.0.5",
|
||||
|
@ -22,9 +23,7 @@
|
|||
"node-libs-browser": "^2.2.1",
|
||||
"react": "^17.0.1",
|
||||
"react-dom": "^17.0.1",
|
||||
"redoc": "2.0.0-rc.77",
|
||||
"styled-components": "^5.3.0",
|
||||
"update-notifier": "^5.0.1",
|
||||
"yargs": "^17.3.1"
|
||||
},
|
||||
"publishConfig": {
|
||||
|
|
Loading…
Reference in New Issue
Block a user