8000 Minor cleanup to lockfile-explorer. · syengineering/rushstack@ec6de91 · GitHub
[go: up one dir, main page]

Skip to content

Commit ec6de91

Browse files
committed
Minor cleanup to lockfile-explorer.
1 parent 296d28e commit ec6de91

File tree

6 files changed

+17
-50
lines changed

6 files changed

+17
-50
lines changed

apps/lockfile-explorer/package.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,16 @@
1717
},
1818
"devDependencies": {
1919
"@rushstack/eslint-config": "workspace:*",
20-
"@rushstack/heft": "workspace:*",
2120
"@rushstack/heft-node-rig": "workspace:*",
21+
"@rushstack/heft": "workspace:*",
2222
"@rushstack/lockfile-explorer-web": "workspace:*",
23-
"@types/heft-jest": "1.0.1",
24-
"@types/node": "12.20.24",
2523
"@types/express": "4.17.13",
26-
"@types/cors": "~2.8.12",
27-
"@types/js-yaml": "3.12.1"
24+
"@types/heft-jest": "1.0.1",
25+
"@types/js-yaml": "3.12.1",
26+
"@types/node": "12.20.24"
2827
},
2928
"dependencies": {
3029
"@types/express": "4.17.13",
31-
"cors": "~2.8.5",
3230
"express": "4.18.1",
3331
"js-yaml": "~3.13.1",
3432
"open": "~8.4.0"

apps/lockfile-explorer/src/start.ts

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,15 @@
11
import express from 'express';
2-
import cors from 'cors';
32
import yaml from 'js-yaml';
4-
const app: express.Application = express();
53
import fs from 'fs';
6-
import * as process from 'process';
74
import path from 'path';
85
import open from 'open';
96

10-
const port: number = 8091;
11-
const appUrl: string = `http://localhost:${port}/app/`;
12-
13-
process.chdir(path.join(__dirname, '..'));
7+
const PORT: number = 8091;
8+
const APP_URL: string = `http://localhost:${PORT}/app/`;
149

15-
app.use(cors());
10+
const app: express.Application = express();
1611

17-
app.use('/app', express.static('dist'));
12+
app.use('/app', express.static(path.resolve(__dirname, '../dist')));
1813

1914
app.get('/', (req: express.Request, res: express.Response) => {
2015
const doc = yaml.load(
@@ -42,13 +37,15 @@ app.get('/parsedCJS', (req: express.Request, res: express.Response) => {
4237
res.send(parsedPackage);
4338
});
4439

45-
app.listen(port, () => {
46-
console.log(`Rush Lockfile Explorer running at ${appUrl}`);
40+
app.listen(PORT, async () => {
41+
console.log(`Rush Lockfile Explorer running at ${APP_URL}`);
4742

48-
if (process.argv.indexOf('--debug') < 0) {
49-
// Launch the web browser
50-
open(appUrl).catch((e) => {
43+
if (!process.argv.includes('--debug')) {
44+
try {
45+
// Launch the web browser
46+
await open(APP_URL);
47+
} catch (e) {
5148
console.error('Error launching browser: ' + e.toString());
52-
});
49+
}
5350
}
5451
});

common/config/rush/browser-approved-packages.json

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,6 @@
1010
"name": "@lifaon/path",
1111
"allowedCategories": [ "libraries" ]
1212
},
13-
{
14-
"name": "axios",
15-
"allowedCategories": [ "libraries" ]
16-
},
1713
{
1814
"name": "react",
1915
"allowedCategories": [ "libraries", "tests" ]
@@ -22,10 +18,6 @@
2218
"name": "react-dom",
2319
"allowedCategories": [ "libraries", "tests" ]
2420
},
25-
{
26-
"name": "react-is",
27-
"allowedCategories": [ "libraries" ]
28-
},
2921
{
3022
"name": "tslib",
3123
"allowedCategories": [ "libraries", "tests" ]

common/config/rush/nonbrowser-approved-packages.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,6 @@
358358
"name": "constructs",
359359
"allowedCategories": [ "tests" ]
360360
},
361-
{
362-
"name": "cors",
363-
"allowedCategories": [ "libraries" ]
364-
},
365361
{
366362
"name": "css-loader",
367363
"allowedCategories": [ "libraries", "tests" ]

common/config/rush/pnpm-lock.yaml

Lines changed: 0 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

common/config/rush/repo-state.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// DO NOT MODIFY THIS FILE MANUALLY BUT DO COMMIT IT. It is generated and used by Rush.
22
{
3-
"pnpmShrinkwrapHash": "59420a81f93646c4186ba05f55ad717d5803afdf",
3+
"pnpmShrinkwrapHash": "2772260740ee0d1cfcb302a317f4b2dcf31fdbe1",
44
"preferredVersionsHash": "5222ca779ae69ebfd201e39c17f48ce9eaf8c3c2"
55
}

0 commit comments

Comments
 (0)
0