fix: pr edits

This commit is contained in:
Ivan Shmidt
2020-05-18 19:50:45 +02:00
parent 860bf51728
commit 9c75999701
4 changed files with 2 additions and 47 deletions
-34
View File
@@ -1,34 +0,0 @@
/*
* Copyright 2020 Spotify AB
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// eslint-disable-next-line
const createProxyMiddleware = require('http-proxy-middleware');
// FIXME: somehow get it from within the plugin itself?
const circleCIProxySettings = {
'/circleci/api': {
target: 'https://circleci.com/api/v1.1',
changeOrigin: true,
logLevel: 'debug',
pathRewrite: {
'^/circleci/api/': '/',
},
},
};
module.exports = (/** @type {import('express').Application} */ app) =>
Object.entries(circleCIProxySettings).forEach(([url, settings]) =>
app.use(url, createProxyMiddleware(settings)),
);
+1
View File
@@ -83,6 +83,7 @@
"@types/diff": "^4.0.2",
"@types/fs-extra": "^8.1.0",
"@types/html-webpack-plugin": "^3.2.2",
"@types/http-proxy": "^1.17.4",
"@types/inquirer": "^6.5.0",
"@types/mini-css-extract-plugin": "^0.9.1",
"@types/node": "^13.7.2",
-6
View File
@@ -14,19 +14,13 @@
* limitations under the License.
*/
import fs from 'fs-extra';
import { Command } from 'commander';
import { serveBundle } from '../../lib/bundler';
import { paths } from '../../lib/paths';
export default async (cmd: Command) => {
const pkgPath = paths.resolveTarget('package.json');
const pkg = await fs.readJson(pkgPath);
const waitForExit = await serveBundle({
entry: 'src/index',
checksEnabled: cmd.check,
proxy: pkg.proxy,
});
await waitForExit();
+1 -7
View File
@@ -14,19 +14,13 @@
* limitations under the License.
*/
import fs from 'fs-extra';
import { serveBundle } from '../../lib/bundler';
import { Command } from 'commander';
import { paths } from '../../lib/paths';
import { serveBundle } from '../../lib/bundler';
export default async (cmd: Command) => {
const pkgPath = paths.resolveTarget('package.json');
const pkg = await fs.readJson(pkgPath);
const waitForExit = await serveBundle({
entry: 'dev/index',
checksEnabled: cmd.check,
proxy: pkg.proxy,
});
await waitForExit();