Remove CRA stuff, revert to custom webpack config

This commit is contained in:
MICHAEL JACKSON
2017-12-14 08:21:45 -08:00
parent 9c042e6368
commit f2daafadfb
28 changed files with 2097 additions and 2490 deletions

17
server/.eslintrc Normal file
View File

@ -0,0 +1,17 @@
{
"parser": "babel-eslint",
"env": {
"node": true
},
"extends": [
"eslint:recommended",
"plugin:import/errors"
],
"rules": {
"no-console": 0
},
"globals": {
"fetch": true,
"Promise": true
}
}

View File

@ -0,0 +1,5 @@
{
"env": {
"jest": true
}
}

View File

@ -1,4 +1,3 @@
const validateNpmPackageName = require("validate-npm-package-name")
const BlacklistAPI = require("../BlacklistAPI")
function removeFromBlacklist(req, res) {

View File

@ -1,9 +1,7 @@
const fs = require("fs")
const path = require("path")
const express = require("express")
const bodyParser = require("body-parser")
const cors = require("cors")
const morgan = require("morgan")
const cors = require("cors")
const checkBlacklist = require("./middleware/checkBlacklist")
const fetchFile = require("./middleware/fetchFile")

View File

@ -31,7 +31,7 @@ function rewriteBareModuleIdentifiers(file, packageConfig, callback) {
/**
* Send the file, JSON metadata, or HTML directory listing.
*/
function serveFile(req, res, next) {
function serveFile(req, res) {
if (req.query.meta != null) {
// Serve JSON metadata.
getMetadata(req.packageDir, req.filename, req.stats, MaximumDepth, (error, metadata) => {

View File

@ -0,0 +1,5 @@
{
"env": {
"jest": true
}
}

View File

@ -0,0 +1,5 @@
{
"env": {
"jest": true
}
}

View File

@ -17,7 +17,7 @@ function stripNamePrefix(headers) {
// so we shorten that to just "index.js" here. A few packages use a
// prefix other than "package/". e.g. the firebase package uses the
// "firebase_npm/" prefix. So we just strip the first dir name.
headers.name = headers.name.replace(/^[^\/]+\//, "")
headers.name = headers.name.replace(/^[^/]+\//, "")
return headers
}

View File

@ -0,0 +1,5 @@
{
"env": {
"jest": true
}
}

View File

@ -1,7 +1,7 @@
const url = require("url")
const validatePackageName = require("./validatePackageName")
const URLFormat = /^\/((?:@[^\/@]+\/)?[^\/@]+)(?:@([^\/]+))?(\/.*)?$/
const URLFormat = /^\/((?:@[^/@]+\/)?[^/@]+)(?:@([^/]+))?(\/.*)?$/
function decodeParam(param) {
if (param) {