Skip to content

Commit ce9164d

Browse files
committed
Move codebase to use single quotes
1 parent c049697 commit ce9164d

File tree

87 files changed

+506
-506
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+506
-506
lines changed

.prettierrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"arrowParens": "always",
33
"printWidth": 120,
44
"semi": true,
5-
"singleQuote": false
5+
"singleQuote": true
66
}

bin/replClient.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import { connect } from "net";
1+
import { connect } from 'net';
22

33
const main = () => {
44
const { argv } = process;
55

6-
let host = "127.0.0.1";
6+
let host = '127.0.0.1';
77
let port = 2580;
88

99
if (argv.length === 4) {
@@ -12,26 +12,26 @@ const main = () => {
1212
} else if (argv.length === 3) {
1313
port = Number(argv[2]);
1414
} else {
15-
throw new Error("The command is supposed to be used as: yarn remote [server address] [REPL port]");
15+
throw new Error('The command is supposed to be used as: yarn remote [server address] [REPL port]');
1616
}
1717

1818
const sock = connect(port, host);
1919

2020
process.stdin.pipe(sock);
2121
sock.pipe(process.stdout);
2222

23-
sock.on("connect", function () {
23+
sock.on('connect', function () {
2424
process.stdin.resume();
2525
process.stdin.setRawMode(true);
2626
});
2727

28-
sock.on("close", function done() {
28+
sock.on('close', function done() {
2929
process.stdin.setRawMode(false);
3030
process.stdin.pause();
31-
sock.removeListener("close", done);
31+
sock.removeListener('close', done);
3232
});
3333

34-
process.stdin.on("end", function () {
34+
process.stdin.on('end', function () {
3535
sock.destroy();
3636
console.log();
3737
});

src/__tests__/TestControls.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { Container, container } from "@/container";
2-
import { withContext } from "@/context";
3-
import { main } from "@/_boot";
4-
import { Db } from "mongodb";
5-
import supertest, { SuperTest, Test } from "supertest";
1+
import { Container, container } from '@/container';
2+
import { withContext } from '@/context';
3+
import { main } from '@/_boot';
4+
import { Db } from 'mongodb';
5+
import supertest, { SuperTest, Test } from 'supertest';
66

77
type Dependencies = {
88
mongo: Db;
@@ -13,7 +13,7 @@ type TestControls = Readonly<{
1313
clearDatabase: () => Promise<void>;
1414
cleanUp: () => Promise<void>;
1515
container: Container;
16-
registry: Container["cradle"];
16+
registry: Container['cradle'];
1717
}>;
1818

1919
const appRunning = withContext(

src/__tests__/setup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
process.env.NODE_ENV = "test";
1+
process.env.NODE_ENV = 'test';
22

33
const catchAll = new Proxy(
44
{},
@@ -9,6 +9,6 @@ const catchAll = new Proxy(
99
}
1010
);
1111

12-
jest.mock("pino", () => () => catchAll);
12+
jest.mock('pino', () => () => catchAll);
1313

1414
console = catchAll;

src/_boot/appModules.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import { articleModule, ArticleRegistry } from "@/article";
2-
import { ArticleMessages } from "@/article/messages";
3-
import { commentModule, CommentRegistry } from "@/comment";
1+
import { articleModule, ArticleRegistry } from '@/article';
2+
import { ArticleMessages } from '@/article/messages';
3+
import { commentModule, CommentRegistry } from '@/comment';
44

55
type AppModulesMessages = ArticleMessages;
66

src/_boot/database.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { makeModule } from "@/context";
2-
import { makeMongoProvider, MongoProvider } from "@/_lib/MongoProvider";
3-
import { asValue } from "awilix";
4-
import { Db, MongoClient } from "mongodb";
1+
import { makeModule } from '@/context';
2+
import { makeMongoProvider, MongoProvider } from '@/_lib/MongoProvider';
3+
import { asValue } from 'awilix';
4+
import { Db, MongoClient } from 'mongodb';
55

66
type DatabaseConfig = {
77
mongodb: {
@@ -12,7 +12,7 @@ type DatabaseConfig = {
1212
};
1313
};
1414

15-
const database = makeModule("database", async ({ container: { register }, config: { mongodb } }) => {
15+
const database = makeModule('database', async ({ container: { register }, config: { mongodb } }) => {
1616
const client = new MongoClient(mongodb.host, {
1717
auth: { username: mongodb.username, password: mongodb.password },
1818
});

src/_boot/index.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { server } from "@/_boot/server";
2-
import { appModules } from "@/_boot/appModules";
3-
import { asValue } from "awilix";
4-
import { database } from "@/_boot/database";
5-
import { repl } from "@/_boot/repl";
6-
import { withContext } from "@/context";
7-
import { Configuration } from "@/config";
8-
import { Logger } from "pino";
9-
import { pubSub } from "@/_boot/pubSub";
10-
import { MessageBundle } from "@/messages";
11-
import { swagger } from "@/_boot/swagger";
1+
import { server } from '@/_boot/server';
2+
import { appModules } from '@/_boot/appModules';
3+
import { asValue } from 'awilix';
4+
import { database } from '@/_boot/database';
5+
import { repl } from '@/_boot/repl';
6+
import { withContext } from '@/context';
7+
import { Configuration } from '@/config';
8+
import { Logger } from 'pino';
9+
import { pubSub } from '@/_boot/pubSub';
10+
import { MessageBundle } from '@/messages';
11+
import { swagger } from '@/_boot/swagger';
1212

1313
const main = withContext(async ({ app, container, config, bootstrap, logger, messageBundle }) => {
1414
container.register({

src/_boot/pubSub.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { makeModule } from "@/context";
2-
import { makeEventEmitterPubSub } from "@/_lib/pubSub/EventEmitterPubSub";
3-
import { asValue } from "awilix";
4-
import { Subscriber } from "@/_lib/events/Subscriber";
5-
import { Publisher } from "@/_lib/events/Publisher";
1+
import { makeModule } from '@/context';
2+
import { makeEventEmitterPubSub } from '@/_lib/pubSub/EventEmitterPubSub';
3+
import { asValue } from 'awilix';
4+
import { Subscriber } from '@/_lib/events/Subscriber';
5+
import { Publisher } from '@/_lib/events/Publisher';
66

7-
const pubSub = makeModule("pubSub", async ({ container: { build, register }, app: { onReady } }) => {
7+
const pubSub = makeModule('pubSub', async ({ container: { build, register }, app: { onReady } }) => {
88
const eventEmitterPubSub = build(makeEventEmitterPubSub);
99

1010
register({

src/_boot/repl.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import REPL, { REPLEval, ReplOptions, REPLServer } from "repl";
2-
import vm from "vm";
3-
import { createServer, Server } from "net";
4-
import { makeModule } from "@/context";
1+
import REPL, { REPLEval, ReplOptions, REPLServer } from 'repl';
2+
import vm from 'vm';
3+
import { createServer, Server } from 'net';
4+
import { makeModule } from '@/context';
55

66
type REPLConfig = {
77
appName: string;
@@ -12,7 +12,7 @@ type REPLConfig = {
1212
};
1313

1414
const repl = makeModule(
15-
"repl",
15+
'repl',
1616
async ({
1717
app: { onReady, terminate },
1818
container,
@@ -34,7 +34,7 @@ const repl = makeModule(
3434
return callback(null, result);
3535
};
3636

37-
const isPromise = (value) => value && typeof value.then === "function" && typeof value.catch === "function";
37+
const isPromise = (value) => value && typeof value.then === 'function' && typeof value.catch === 'function';
3838

3939
const createREPL = (
4040
config: Partial<ReplOptions> = { input: process.stdin, output: process.stdout }
@@ -57,21 +57,21 @@ const repl = makeModule(
5757
if (cli) {
5858
const repl = createREPL();
5959

60-
repl.on("close", terminate);
61-
} else if (!["production", "test"].includes(environment)) {
60+
repl.on('close', terminate);
61+
} else if (!['production', 'test'].includes(environment)) {
6262
server = createServer((socket) => {
6363
const repl = createREPL({
6464
input: socket,
6565
output: socket,
6666
terminal: true,
6767
});
6868

69-
repl.on("close", () => {
69+
repl.on('close', () => {
7070
socket.end();
7171
});
7272

73-
socket.on("error", (err) => {
74-
logger.error("[REPL] Connection error");
73+
socket.on('error', (err) => {
74+
logger.error('[REPL] Connection error');
7575
logger.error(err);
7676
socket.end();
7777
});

src/_boot/server.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import express, { Router, Application, json, urlencoded } from "express";
2-
import { asValue } from "awilix";
3-
import httpLogger from "pino-http";
4-
import { createServer } from "http";
5-
import { requestId } from "@/_lib/http/middlewares/requestId";
6-
import { requestContainer } from "@/_lib/http/middlewares/requestContainer";
7-
import { errorHandler } from "@/_lib/http/middlewares/errorHandler";
8-
import { makeModule } from "@/context";
9-
import { gracefulShutdown } from "@/_lib/http/middlewares/gracefulShutdown";
10-
import { errorConverters } from "@/_sharedKernel/interface/http/ErrorConverters";
1+
import express, { Router, Application, json, urlencoded } from 'express';
2+
import { asValue } from 'awilix';
3+
import httpLogger from 'pino-http';
4+
import { createServer } from 'http';
5+
import { requestId } from '@/_lib/http/middlewares/requestId';
6+
import { requestContainer } from '@/_lib/http/middlewares/requestContainer';
7+
import { errorHandler } from '@/_lib/http/middlewares/errorHandler';
8+
import { makeModule } from '@/context';
9+
import { gracefulShutdown } from '@/_lib/http/middlewares/gracefulShutdown';
10+
import { errorConverters } from '@/_sharedKernel/interface/http/ErrorConverters';
1111

1212
type ServerConfig = {
1313
http: {
@@ -17,7 +17,7 @@ type ServerConfig = {
1717
};
1818

1919
const server = makeModule(
20-
"server",
20+
'server',
2121
async ({ app: { onBooted, onReady }, container, config: { cli, http, environment }, logger }) => {
2222
const { register } = container;
2323
const server = express();
@@ -36,7 +36,7 @@ const server = makeModule(
3636
const rootRouter = Router();
3737
const apiRouter = Router();
3838

39-
rootRouter.use("/api", apiRouter);
39+
rootRouter.use('/api', apiRouter);
4040

4141
server.use(rootRouter);
4242

@@ -48,7 +48,7 @@ const server = makeModule(
4848
server.use(errorHandler(errorConverters, { logger }));
4949
});
5050

51-
if (!cli && environment !== "test") {
51+
if (!cli && environment !== 'test') {
5252
onReady(
5353
async () =>
5454
new Promise<void>((resolve) => {

0 commit comments

Comments
 (0)