Skip to content

Commit 8a0fefe

Browse files
Andriy Pyvovarchukmgechev
authored andcommitted
refactor: replace deprecated package opn with open
1 parent 21202f4 commit 8a0fefe

File tree

5 files changed

+1035
-1458
lines changed

5 files changed

+1035
-1458
lines changed

packages/angular/cli/commands/doc-impl.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Command } from '../models/command';
1010
import { Arguments } from '../models/interface';
1111
import { Schema as DocCommandSchema } from './doc';
1212

13-
const opn = require('opn');
13+
const open = require('open');
1414

1515
export class DocCommand extends Command<DocCommandSchema> {
1616
public async run(options: DocCommandSchema & Arguments) {
@@ -24,9 +24,9 @@ export class DocCommand extends Command<DocCommandSchema> {
2424
searchUrl = `https://www.google.com/search?q=site%3Aangular.io+${options.keyword}`;
2525
}
2626

27-
// We should wrap `opn` in a new Promise because `opn` is already resolved
27+
// We should wrap `open` in a new Promise because `open` is already resolved
2828
await new Promise(() => {
29-
opn(searchUrl, {
29+
open(searchUrl, {
3030
wait: false,
3131
});
3232
});

packages/angular/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"ini": "1.3.5",
3636
"inquirer": "6.2.1",
3737
"npm-package-arg": "6.1.0",
38-
"opn": "5.4.0",
38+
"open": "6.0.0",
3939
"pacote": "9.4.0",
4040
"semver": "5.6.0",
4141
"symbol-observable": "1.2.0"

packages/angular_devkit/build_angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"mini-css-extract-plugin": "0.5.0",
2828
"minimatch": "3.0.4",
2929
"parse5": "4.0.0",
30-
"opn": "5.4.0",
30+
"open": "6.0.0",
3131
"postcss": "7.0.14",
3232
"postcss-import": "12.0.1",
3333
"postcss-loader": "3.0.0",

packages/angular_devkit/build_angular/src/dev-server/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { checkPort } from '../angular-cli-files/utilities/check-port';
2525
import { BrowserBuilder, getBrowserLoggingCb } from '../browser';
2626
import { BrowserBuilderSchema, NormalizedBrowserBuilderSchema } from '../browser/schema';
2727
import { normalizeBuilderSchema } from '../utils';
28-
const opn = require('opn');
28+
const open = require('open');
2929

3030

3131
export interface DevServerBuilderOptions extends Pick<BrowserBuilderSchema,
@@ -65,7 +65,7 @@ export class DevServerBuilder implements Builder<DevServerBuilderOptions> {
6565
const webpackDevServerBuilder = new WebpackDevServerBuilder({ ...this.context, host });
6666
let browserOptions: NormalizedBrowserBuilderSchema;
6767
let first = true;
68-
let opnAddress: string;
68+
let openAddress: string;
6969

7070
return from(checkPort(options.port || 0, options.host || 'localhost', 4200)).pipe(
7171
tap((port) => options.port = port),
@@ -145,7 +145,7 @@ export class DevServerBuilder implements Builder<DevServerBuilderOptions> {
145145
**
146146
`);
147147

148-
opnAddress = serverAddress + webpackDevServerConfig.publicPath;
148+
openAddress = serverAddress + webpackDevServerConfig.publicPath;
149149
webpackConfig.devServer = webpackDevServerConfig;
150150

151151
return webpackDevServerBuilder.runWebpackDevServer(
@@ -155,7 +155,7 @@ export class DevServerBuilder implements Builder<DevServerBuilderOptions> {
155155
map(buildEvent => {
156156
if (first && options.open) {
157157
first = false;
158-
opn(opnAddress);
158+
open(openAddress);
159159
}
160160

161161
return buildEvent;

0 commit comments

Comments
 (0)