chore: tidy
This commit is contained in:
parent
cc4ec9c30b
commit
6976fa8183
1
TODO.md
1
TODO.md
|
@ -34,6 +34,5 @@
|
||||||
|
|
||||||
# Webpack 5
|
# Webpack 5
|
||||||
|
|
||||||
fixup no-param-reassign
|
|
||||||
warningsFilter deprecated
|
warningsFilter deprecated
|
||||||
refactor stats
|
refactor stats
|
||||||
|
|
|
@ -20,7 +20,6 @@ export const hooks = {
|
||||||
),
|
),
|
||||||
'@flecks/core/test/invoke': () => 69,
|
'@flecks/core/test/invoke': () => 69,
|
||||||
'@flecks/core/test/invoke-parallel': (O) => {
|
'@flecks/core/test/invoke-parallel': (O) => {
|
||||||
// eslint-disable-next-line no-param-reassign
|
|
||||||
O.foo *= 2;
|
O.foo *= 2;
|
||||||
},
|
},
|
||||||
'@flecks/core/test/invoke-merge': () => ({foo: 69}),
|
'@flecks/core/test/invoke-merge': () => ({foo: 69}),
|
||||||
|
@ -28,7 +27,6 @@ export const hooks = {
|
||||||
'@flecks/core/test/invoke-merge-unique': () => ({foo: 69}),
|
'@flecks/core/test/invoke-merge-unique': () => ({foo: 69}),
|
||||||
'@flecks/core/test/invoke-merge-unique-async': () => new Promise((resolve) => { resolve({foo: 69}); }),
|
'@flecks/core/test/invoke-merge-unique-async': () => new Promise((resolve) => { resolve({foo: 69}); }),
|
||||||
'@flecks/core/test.middleware': () => (foo, next) => {
|
'@flecks/core/test.middleware': () => (foo, next) => {
|
||||||
// eslint-disable-next-line no-param-reassign
|
|
||||||
foo.bar += 1;
|
foo.bar += 1;
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
|
|
|
@ -7,7 +7,6 @@ export const hooks = {
|
||||||
'@flecks/core/test/invoke': () => 420,
|
'@flecks/core/test/invoke': () => 420,
|
||||||
'@flecks/core/test/invoke-parallel': (O) => new Promise((resolve) => {
|
'@flecks/core/test/invoke-parallel': (O) => new Promise((resolve) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
// eslint-disable-next-line no-param-reassign
|
|
||||||
O.foo += 2;
|
O.foo += 2;
|
||||||
resolve();
|
resolve();
|
||||||
}, 0);
|
}, 0);
|
||||||
|
@ -17,7 +16,6 @@ export const hooks = {
|
||||||
'@flecks/core/test/invoke-merge-unique': () => ({foo: 69}),
|
'@flecks/core/test/invoke-merge-unique': () => ({foo: 69}),
|
||||||
'@flecks/core/test/invoke-merge-unique-async': () => new Promise((resolve) => { resolve({foo: 69}); }),
|
'@flecks/core/test/invoke-merge-unique-async': () => new Promise((resolve) => { resolve({foo: 69}); }),
|
||||||
'@flecks/core/test.middleware': () => (foo, next) => {
|
'@flecks/core/test.middleware': () => (foo, next) => {
|
||||||
// eslint-disable-next-line no-param-reassign
|
|
||||||
foo.bar *= 2;
|
foo.bar *= 2;
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
|
|
|
@ -32,7 +32,6 @@ export default (flecks) => {
|
||||||
this.destroy({where: {id: ban.id}});
|
this.destroy({where: {id: ban.id}});
|
||||||
return [...r, null];
|
return [...r, null];
|
||||||
}
|
}
|
||||||
// eslint-disable-next-line no-param-reassign
|
|
||||||
ban.ttl = Math.ceil((expiresAt.getTime() - Date.now()) / 1000);
|
ban.ttl = Math.ceil((expiresAt.getTime() - Date.now()) / 1000);
|
||||||
}
|
}
|
||||||
return [...r, ban];
|
return [...r, ban];
|
||||||
|
|
|
@ -3,7 +3,6 @@ import {augmentBuild} from '@flecks/web/server';
|
||||||
import ssr from './ssr';
|
import ssr from './ssr';
|
||||||
|
|
||||||
export const hooks = {
|
export const hooks = {
|
||||||
/* eslint-disable no-param-reassign */
|
|
||||||
'@flecks/core.build': (target, config, env, argv, flecks) => {
|
'@flecks/core.build': (target, config, env, argv, flecks) => {
|
||||||
const isProduction = 'production' === argv.mode;
|
const isProduction = 'production' === argv.mode;
|
||||||
config.resolve.alias['react-native'] = 'react-native-web';
|
config.resolve.alias['react-native'] = 'react-native-web';
|
||||||
|
@ -18,7 +17,6 @@ export const hooks = {
|
||||||
augmentBuild(target, config, env, argv, flecks);
|
augmentBuild(target, config, env, argv, flecks);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/* eslint-enable no-param-reassign */
|
|
||||||
'@flecks/web/server.stream.html': (stream, req, flecks) => (
|
'@flecks/web/server.stream.html': (stream, req, flecks) => (
|
||||||
flecks.get('@flecks/react.ssr') ? ssr(stream, req, flecks) : stream
|
flecks.get('@flecks/react.ssr') ? ssr(stream, req, flecks) : stream
|
||||||
),
|
),
|
||||||
|
|
|
@ -21,14 +21,12 @@ export default (key) => (Superclass) => {
|
||||||
);
|
);
|
||||||
Packer.pack = key
|
Packer.pack = key
|
||||||
? (data) => {
|
? (data) => {
|
||||||
// eslint-disable-next-line no-param-reassign
|
|
||||||
data[key] = msgpack.encode(data[key]);
|
data[key] = msgpack.encode(data[key]);
|
||||||
return Superclass.pack(data);
|
return Superclass.pack(data);
|
||||||
}
|
}
|
||||||
: (data) => msgpack.encode(data);
|
: (data) => msgpack.encode(data);
|
||||||
Packer.unpack = key
|
Packer.unpack = key
|
||||||
? (data) => {
|
? (data) => {
|
||||||
// eslint-disable-next-line no-param-reassign
|
|
||||||
data[key] = msgpack.decode(data[key]);
|
data[key] = msgpack.decode(data[key]);
|
||||||
return Superclass.pack(data);
|
return Superclass.pack(data);
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,6 @@ export const hooks = {
|
||||||
passport.initialize()(socket.handshake, undefined, () => {
|
passport.initialize()(socket.handshake, undefined, () => {
|
||||||
debugSilly('@flecks/socket/server.request.socket: passport.session()');
|
debugSilly('@flecks/socket/server.request.socket: passport.session()');
|
||||||
passport.session()(socket.handshake, undefined, async () => {
|
passport.session()(socket.handshake, undefined, async () => {
|
||||||
/* eslint-disable no-param-reassign */
|
|
||||||
if (!socket.handshake.user) {
|
if (!socket.handshake.user) {
|
||||||
const {User} = flecks.get('$flecks/db.models');
|
const {User} = flecks.get('$flecks/db.models');
|
||||||
socket.handshake.user = new User();
|
socket.handshake.user = new User();
|
||||||
|
@ -74,7 +73,6 @@ export const hooks = {
|
||||||
socket.handshake.logOut = LogOps.logOut;
|
socket.handshake.logOut = LogOps.logOut;
|
||||||
socket.handshake.isAuthenticated = LogOps.isAuthenticated;
|
socket.handshake.isAuthenticated = LogOps.isAuthenticated;
|
||||||
socket.handshake.isUnauthenticated = LogOps.isUnauthenticated;
|
socket.handshake.isUnauthenticated = LogOps.isUnauthenticated;
|
||||||
/* eslint-enable no-param-reassign */
|
|
||||||
await socket.join(`/u/${socket.handshake.user.id}`);
|
await socket.join(`/u/${socket.handshake.user.id}`);
|
||||||
next();
|
next();
|
||||||
});
|
});
|
||||||
|
|
|
@ -20,7 +20,6 @@ const slice = createSlice({
|
||||||
entities: {0: {name: 'anonymous'}},
|
entities: {0: {name: 'anonymous'}},
|
||||||
ids: [0],
|
ids: [0],
|
||||||
}),
|
}),
|
||||||
/* eslint-disable no-param-reassign */
|
|
||||||
extraReducers: (builder) => {
|
extraReducers: (builder) => {
|
||||||
builder.addCase(hydrateLocalStorage, (state, action) => {
|
builder.addCase(hydrateLocalStorage, (state, action) => {
|
||||||
const storage = action.payload;
|
const storage = action.payload;
|
||||||
|
@ -38,7 +37,6 @@ const slice = createSlice({
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/* eslint-enable no-param-reassign */
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export default slice.reducer;
|
export default slice.reducer;
|
||||||
|
|
|
@ -45,9 +45,8 @@ const {version} = require('@flecks/web/package.json');
|
||||||
}
|
}
|
||||||
const progress = new Progress(window);
|
const progress = new Progress(window);
|
||||||
debug('loading runtime...');
|
debug('loading runtime...');
|
||||||
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
||||||
const {default: loader} = await import(
|
const {default: loader} = await import(
|
||||||
/* webpackChunkName: "flecks-runtime" */
|
/* webpackChunkName: "flecks-runtime" */ // eslint-disable-next-line import/no-unresolved
|
||||||
'@flecks/web/runtime'
|
'@flecks/web/runtime'
|
||||||
);
|
);
|
||||||
const runtime = await loader(progress.update.bind(progress));
|
const runtime = await loader(progress.update.bind(progress));
|
||||||
|
|
|
@ -21,7 +21,6 @@ export const hooks = {
|
||||||
'@flecks/core.build.alter': async (configs, env, argv, flecks) => {
|
'@flecks/core.build.alter': async (configs, env, argv, flecks) => {
|
||||||
// Don't build if there's a fleck target.
|
// Don't build if there's a fleck target.
|
||||||
if (configs.fleck && !flecks.get('@flecks/web/server.forceBuildWithFleck')) {
|
if (configs.fleck && !flecks.get('@flecks/web/server.forceBuildWithFleck')) {
|
||||||
// eslint-disable-next-line no-param-reassign
|
|
||||||
delete configs.web;
|
delete configs.web;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -29,7 +28,6 @@ export const hooks = {
|
||||||
// Only build vendor in dev.
|
// Only build vendor in dev.
|
||||||
if (configs['web-vendor']) {
|
if (configs['web-vendor']) {
|
||||||
if (isProduction) {
|
if (isProduction) {
|
||||||
// eslint-disable-next-line no-param-reassign
|
|
||||||
delete configs['web-vendor'];
|
delete configs['web-vendor'];
|
||||||
}
|
}
|
||||||
// Only build if something actually changed.
|
// Only build if something actually changed.
|
||||||
|
@ -65,7 +63,6 @@ export const hooks = {
|
||||||
catch (error) {}
|
catch (error) {}
|
||||||
}
|
}
|
||||||
if (timestamp > latest) {
|
if (timestamp > latest) {
|
||||||
// eslint-disable-next-line no-param-reassign
|
|
||||||
delete configs['web-vendor'];
|
delete configs['web-vendor'];
|
||||||
}
|
}
|
||||||
else if (timestamp > 0) {
|
else if (timestamp > 0) {
|
||||||
|
@ -104,7 +101,6 @@ export const hooks = {
|
||||||
child.kill();
|
child.kill();
|
||||||
});
|
});
|
||||||
// Remove the build config since we're handing off to WDS.
|
// Remove the build config since we're handing off to WDS.
|
||||||
// eslint-disable-next-line no-param-reassign
|
|
||||||
delete configs.web;
|
delete configs.web;
|
||||||
},
|
},
|
||||||
'@flecks/core.build.config': () => [
|
'@flecks/core.build.config': () => [
|
||||||
|
|
Loading…
Reference in New Issue
Block a user