mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-20 14:25:07 +00:00
switch to polka, remove unused deps
This commit is contained in:
@@ -24,12 +24,12 @@
|
|||||||
"chokidar": "^1.7.0",
|
"chokidar": "^1.7.0",
|
||||||
"code-frame": "^5.0.0",
|
"code-frame": "^5.0.0",
|
||||||
"escape-html": "^1.0.3",
|
"escape-html": "^1.0.3",
|
||||||
"express": "^4.16.2",
|
|
||||||
"glob": "^7.1.2",
|
"glob": "^7.1.2",
|
||||||
"locate-character": "^2.0.5",
|
"locate-character": "^2.0.5",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"mri": "^1.1.0",
|
"mri": "^1.1.0",
|
||||||
"node-fetch": "^1.7.3",
|
"node-fetch": "^1.7.3",
|
||||||
|
"polka": "^0.3.4",
|
||||||
"port-authority": "^1.0.0",
|
"port-authority": "^1.0.0",
|
||||||
"pretty-ms": "^3.1.0",
|
"pretty-ms": "^3.1.0",
|
||||||
"relative": "^3.0.2",
|
"relative": "^3.0.2",
|
||||||
@@ -50,7 +50,6 @@
|
|||||||
"@types/mkdirp": "^0.5.2",
|
"@types/mkdirp": "^0.5.2",
|
||||||
"@types/rimraf": "^2.0.2",
|
"@types/rimraf": "^2.0.2",
|
||||||
"compression": "^1.7.1",
|
"compression": "^1.7.1",
|
||||||
"css-loader": "^0.28.7",
|
|
||||||
"electron": "^1.8.2",
|
"electron": "^1.8.2",
|
||||||
"eslint": "^4.13.1",
|
"eslint": "^4.13.1",
|
||||||
"eslint-plugin-import": "^2.8.0",
|
"eslint-plugin-import": "^2.8.0",
|
||||||
@@ -63,7 +62,7 @@
|
|||||||
"rollup-plugin-json": "^2.3.0",
|
"rollup-plugin-json": "^2.3.0",
|
||||||
"rollup-plugin-string": "^2.0.2",
|
"rollup-plugin-string": "^2.0.2",
|
||||||
"rollup-plugin-typescript": "^0.8.1",
|
"rollup-plugin-typescript": "^0.8.1",
|
||||||
"style-loader": "^0.19.1",
|
"serve-static": "^1.13.2",
|
||||||
"svelte": "^1.49.1",
|
"svelte": "^1.49.1",
|
||||||
"svelte-loader": "^2.3.2",
|
"svelte-loader": "^2.3.2",
|
||||||
"ts-node": "^4.1.0",
|
"ts-node": "^4.1.0",
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
import * as child_process from 'child_process';
|
import * as child_process from 'child_process';
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
import * as sander from 'sander';
|
import * as sander from 'sander';
|
||||||
import express from 'express';
|
import polka from 'polka';
|
||||||
import cheerio from 'cheerio';
|
import cheerio from 'cheerio';
|
||||||
import URL from 'url-parse';
|
import URL from 'url-parse';
|
||||||
import fetch from 'node-fetch';
|
import fetch from 'node-fetch';
|
||||||
import * as ports from 'port-authority';
|
import * as ports from 'port-authority';
|
||||||
import { dest } from '../config';
|
import { dest } from '../config';
|
||||||
|
|
||||||
const app = express();
|
const app = polka();
|
||||||
|
|
||||||
function read_json(file: string) {
|
function read_json(file: string) {
|
||||||
return JSON.parse(sander.readFileSync(file, { encoding: 'utf-8' }));
|
return JSON.parse(sander.readFileSync(file, { encoding: 'utf-8' }));
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import express from 'express';
|
import polka from 'polka';
|
||||||
import compression from 'compression';
|
import compression from 'compression';
|
||||||
import serve from 'serve-static';
|
import serve from 'serve-static';
|
||||||
import sapper from '../../../middleware';
|
import sapper from '../../../middleware';
|
||||||
@@ -28,7 +28,7 @@ process.on('message', message => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
const app = express();
|
const app = polka();
|
||||||
|
|
||||||
app.use((req, res, next) => {
|
app.use((req, res, next) => {
|
||||||
if (pending) pending.add(req.url);
|
if (pending) pending.add(req.url);
|
||||||
|
|||||||
5955
test/app/package-lock.json
generated
5955
test/app/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,28 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "TODO",
|
|
||||||
"description": "TODO",
|
|
||||||
"version": "0.0.1",
|
|
||||||
"scripts": {
|
|
||||||
"dev": "node server.js",
|
|
||||||
"build": "sapper build",
|
|
||||||
"start": "cross-env NODE_ENV=production node server.js",
|
|
||||||
"prestart": "npm run build"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"compression": "^1.7.2",
|
|
||||||
"cross-env": "^5.1.3",
|
|
||||||
"css-loader": "^0.28.10",
|
|
||||||
"express": "^4.16.2",
|
|
||||||
"extract-text-webpack-plugin": "^3.0.2",
|
|
||||||
"glob": "^7.1.2",
|
|
||||||
"marked": "^0.3.17",
|
|
||||||
"node-fetch": "^1.7.3",
|
|
||||||
"npm-run-all": "^4.1.2",
|
|
||||||
"serve-static": "^1.13.2",
|
|
||||||
"style-loader": "^0.19.0",
|
|
||||||
"svelte": "^1.56.0",
|
|
||||||
"svelte-loader": "^2.3.3",
|
|
||||||
"uglifyjs-webpack-plugin": "^1.2.2",
|
|
||||||
"webpack": "^4.1.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
export function del(req, res) {
|
export function del(req, res) {
|
||||||
res.set({
|
res.writeHead(200, {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ const contents = JSON.stringify(posts.map(post => {
|
|||||||
}));
|
}));
|
||||||
|
|
||||||
export function get(req, res) {
|
export function get(req, res) {
|
||||||
res.set({
|
res.writeHead(200, {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Cache-Control': `max-age=${30 * 60 * 1e3}` // cache for 30 minutes
|
'Cache-Control': `max-age=${30 * 60 * 1e3}` // cache for 30 minutes
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export function get(req, res, next) {
|
|||||||
const { slug } = req.params;
|
const { slug } = req.params;
|
||||||
|
|
||||||
if (slug in lookup) {
|
if (slug in lookup) {
|
||||||
res.set({
|
res.writeHead(200, {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'Cache-Control': `no-cache`
|
'Cache-Control': `no-cache`
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
const config = require('../../../webpack/config.js');
|
const config = require('../../../webpack/config.js');
|
||||||
const pkg = require('../package.json');
|
|
||||||
const sapper_pkg = require('../../../package.json');
|
const sapper_pkg = require('../../../package.json');
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
@@ -9,7 +8,10 @@ module.exports = {
|
|||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.js', '.html']
|
extensions: ['.js', '.html']
|
||||||
},
|
},
|
||||||
externals: Object.keys(pkg.dependencies).concat(Object.keys(sapper_pkg.dependencies)),
|
externals: [].concat(
|
||||||
|
Object.keys(sapper_pkg.dependencies),
|
||||||
|
Object.keys(sapper_pkg.devDependencies)
|
||||||
|
),
|
||||||
module: {
|
module: {
|
||||||
rules: [
|
rules: [
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
const path = require('path');
|
const path = require('path');
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
const Nightmare = require('nightmare');
|
const Nightmare = require('nightmare');
|
||||||
const express = require('express');
|
|
||||||
const serve = require('serve-static');
|
const serve = require('serve-static');
|
||||||
const walkSync = require('walk-sync');
|
const walkSync = require('walk-sync');
|
||||||
const fetch = require('node-fetch');
|
const fetch = require('node-fetch');
|
||||||
|
|||||||
Reference in New Issue
Block a user