Skip to content

Commit

Permalink
Merge pull request #185 from kirovboris/update_nextjs
Browse files Browse the repository at this point in the history
feat: update nextjs
  • Loading branch information
kirovboris authored Mar 31, 2022
2 parents c66909c + e5b6e8a commit a77ca8c
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 27 deletions.
5 changes: 4 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
{
"parser": "babel-eslint",
"parser": "@babel/eslint-parser",
"parserOptions": {
"requireConfigFile": false
},
"extends": "eslint:recommended",
"rules": {
"no-alert": 2,
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,5 @@ node_modules/*
.idea/*
lib/*
test/data/lib/*
test/data/server-render/.next
package-lock.json
10 changes: 5 additions & 5 deletions Gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const babel = require('gulp-babel');
const createTestCafe = require('testcafe');
const del = require('del');
const eslint = require('gulp-eslint');
const eslint = require('gulp-eslint-new');
const fs = require('fs');
const glob = require('glob');
const gulp = require('gulp');
Expand All @@ -26,8 +26,8 @@ gulp.task('lint', () => {
return gulp
.src([
'src/**/*.js',
'test/**/*.{js,ts}',
'!test/data/**/*.js',
'test/**/*.js',
'!test/data/**',
'Gulpfile.js'
])
.pipe(eslint())
Expand Down Expand Up @@ -76,7 +76,7 @@ gulp.task('clean-build-tmp-resources', () => {
});

gulp.task('build-nextjs-app', () => {
const appPath = pathJoin(__dirname, './test/data/lib/server-render');
const appPath = pathJoin(__dirname, './test/data/server-render');

return nextBuild(appPath, require('./next.config.js'));
});
Expand All @@ -89,7 +89,7 @@ gulp.task('run-tests', async cb => {
await startTestServer();

const testCafe = await createTestCafe('localhost', 1337, 1338);

await testCafe.createRunner()
.src(files)
.browsers(['chrome', 'firefox', 'ie'])
Expand Down
7 changes: 5 additions & 2 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module.exports = {
webpack (cfg) {
cfg.mode = 'development';
cfg.optimization = {
minimize: false
};
Expand All @@ -9,5 +8,9 @@ module.exports = {
},

staticMarkup: true,
dev: true
dev: true,

eslint: {
ignoreDuringBuilds: true
}
};
17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,22 @@
},
"license": "MIT",
"devDependencies": {
"babel-eslint": "^10.0.3",
"babel-plugin-transform-for-of-as-array": "^1.1.1",
"babel-preset-env": "^1.6.1",
"babel-preset-es2015-loose": "^6.1.4",
"babel-preset-react": "^6.5.0",
"@babel/core": "^7.17.8",
"@babel/eslint-parser": "^7.17.0",
"@babel/plugin-transform-for-of": "^7.16.7",
"@babel/plugin-transform-runtime": "^7.17.0",
"@babel/preset-env": "^7.16.11",
"@babel/preset-react": "^7.16.7",
"chai": "^3.2.0",
"del": "^1.2.0",
"express": "^4.16.3",
"glob": "^7.1.7",
"gulp": "^4.0.2",
"gulp-babel": "^6.1.3",
"gulp-eslint": "^6.0.0",
"gulp-babel": "8.0.0",
"gulp-eslint-new": "^1.4.2",
"gulp-mustache": "^3.0.1",
"gulp-rename": "^1.2.2",
"next": "^11.1.0",
"next": "^12.1.0",
"publish-please": "^5.5.2",
"react": "^17.0.1",
"react-dom": "^17.0.1",
Expand Down
10 changes: 3 additions & 7 deletions src/.babelrc
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
{
"compact": false,
"presets": [
["env", {
["@babel/preset-env", {
"targets": {
"node": "8"
},
"exclude": ["transform-es2015-typeof-symbol"]
"browsers": ["last 2 versions","IE>=11"]
}
}]
],
"plugins": [
"transform-for-of-as-array"
]
}
File renamed without changes.
9 changes: 6 additions & 3 deletions test/data/src/.babelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"compact": false,

"presets": [
"es2015-loose",
"react"
"@babel/preset-react",
["@babel/preset-env", {
"targets": {
"browsers": ["last 2 versions","IE>=11"]
}
}]
]
}
2 changes: 1 addition & 1 deletion test/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module.exports = function () {

function serverRenderHandler (req, res) {
if (!nextjsApp) {
nextjsApp = next({ dir: path.join(__dirname, './data/lib/server-render') });
nextjsApp = next({ dir: path.join(__dirname, './data/server-render') });
handle = nextjsApp.getRequestHandler();
}

Expand Down

0 comments on commit a77ca8c

Please sign in to comment.