-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: added prettier and format all existing files (#220)
Co-authored-by: Agustina <agusaldasoro@users.noreply.github.com> Co-authored-by: Agustina Aldasoro <agusaldasoro@gmail.com>
- Loading branch information
1 parent
2b0fabe
commit 89fb48b
Showing
267 changed files
with
17,998 additions
and
15,204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import { env, envTLD } from "dcl-ops-lib/domain"; | ||
import { buildStatic } from "dcl-ops-lib/buildStatic"; | ||
import { globalConfig } from "dcl-ops-lib/values"; | ||
import { env, envTLD } from 'dcl-ops-lib/domain' | ||
import { buildStatic } from 'dcl-ops-lib/buildStatic' | ||
import { globalConfig } from 'dcl-ops-lib/values' | ||
|
||
const { defaultSecurityGroupName } = globalConfig[env] | ||
|
||
async function main() { | ||
const builder = buildStatic({ | ||
domain: `catalysts.decentraland.${envTLD}`, | ||
}); | ||
domain: `catalysts.decentraland.${envTLD}` | ||
}) | ||
|
||
return { | ||
cloudfrontDistribution: builder.cloudfrontDistribution, | ||
bucketName: builder.contentBucket, | ||
}; | ||
bucketName: builder.contentBucket | ||
} | ||
} | ||
export = main; | ||
export = main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
dist | ||
bazel-out | ||
tmpbin | ||
linked-peer-package | ||
**/*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
import { EthAddress } from "dcl-crypto"; | ||
import { EthAddress } from 'dcl-crypto' | ||
export type ServerMetadata = { | ||
address: string; | ||
owner: EthAddress; | ||
id: string; | ||
}; | ||
address: string | ||
owner: EthAddress | ||
id: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import { EthAddress } from "dcl-crypto"; | ||
import { EthAddress } from 'dcl-crypto' | ||
|
||
export const DECENTRALAND_ADDRESS: EthAddress = "0x1337e0507eb4ab47e08a179573ed4533d9e22a7b"; | ||
export const DECENTRALAND_ADDRESS: EthAddress = '0x1337e0507eb4ab47e08a179573ed4533d9e22a7b' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import fs from "fs"; | ||
import fs from 'fs' | ||
|
||
export async function existPath(path: string): Promise<boolean> { | ||
try { | ||
await fs.promises.access(path, fs.constants.F_OK | fs.constants.W_OK); | ||
return true; | ||
await fs.promises.access(path, fs.constants.F_OK | fs.constants.W_OK) | ||
return true | ||
} catch (error) { | ||
return false; | ||
return false | ||
} | ||
} | ||
|
||
export async function ensureDirectoryExists(directory: string): Promise<void> { | ||
const alreadyExist = await existPath(directory) | ||
if (!alreadyExist) { | ||
try { | ||
await fs.promises.mkdir(directory, { recursive: true }); | ||
} catch (error) { | ||
// Ignore these errors | ||
} | ||
try { | ||
await fs.promises.mkdir(directory, { recursive: true }) | ||
} catch (error) { | ||
// Ignore these errors | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,56 @@ | ||
import express from 'express'; | ||
import ResponseTime from 'response-time'; | ||
import { register as Register, Counter, Summary, collectDefaultMetrics } from 'prom-client'; | ||
import express from 'express' | ||
import ResponseTime from 'response-time' | ||
import { register as Register, Counter, Summary, collectDefaultMetrics } from 'prom-client' | ||
|
||
const pathsTaken = new Counter({ | ||
name: 'paths_taken', | ||
help: 'Paths taken in the app', | ||
labelNames: ['path'] | ||
}); | ||
name: 'paths_taken', | ||
help: 'Paths taken in the app', | ||
labelNames: ['path'] | ||
}) | ||
|
||
const responses = new Summary({ | ||
name: 'http_responses', | ||
help: 'Response time in milliseconds', | ||
labelNames: ['method', 'path', 'status'] | ||
}); | ||
name: 'http_responses', | ||
help: 'Response time in milliseconds', | ||
labelNames: ['method', 'path', 'status'] | ||
}) | ||
|
||
const numRequests = new Counter({ | ||
name: 'num_requests', | ||
help: 'Number of requests made', | ||
labelNames: ['method'] | ||
}); | ||
name: 'num_requests', | ||
help: 'Number of requests made', | ||
labelNames: ['method'] | ||
}) | ||
|
||
const port = parseInt(process.env.METRICS_PORT ?? "9090"); | ||
const port = parseInt(process.env.METRICS_PORT ?? '9090') | ||
|
||
export class Metrics { | ||
static initialize(app: express.Express) { | ||
const metricsServer = express(); | ||
app.use(Metrics.requestCounters); | ||
app.use(Metrics.responseCounters); | ||
this.injectMetricsRoute(metricsServer); | ||
this.startCollection(metricsServer); | ||
} | ||
|
||
static requestCounters = function (req, res, next) { | ||
numRequests.inc({ method: req.method }); | ||
pathsTaken.inc({ path: req.path }); | ||
next(); | ||
} | ||
|
||
static responseCounters = ResponseTime(function (req, res, time) { | ||
responses.labels(req.method, req.url, res.statusCode).observe(time); | ||
static initialize(app: express.Express) { | ||
const metricsServer = express() | ||
app.use(Metrics.requestCounters) | ||
app.use(Metrics.responseCounters) | ||
this.injectMetricsRoute(metricsServer) | ||
this.startCollection(metricsServer) | ||
} | ||
|
||
static requestCounters = function (req, res, next) { | ||
numRequests.inc({ method: req.method }) | ||
pathsTaken.inc({ path: req.path }) | ||
next() | ||
} | ||
|
||
static responseCounters = ResponseTime(function (req, res, time) { | ||
responses.labels(req.method, req.url, res.statusCode).observe(time) | ||
}) | ||
|
||
static injectMetricsRoute(app: express.Express) { | ||
app.get('/metrics', (req, res) => { | ||
res.set('Content-Type', Register.contentType) | ||
res.end(Register.metrics()) | ||
}) | ||
|
||
static injectMetricsRoute(app: express.Express) { | ||
app.get('/metrics', (req, res) => { | ||
res.set('Content-Type', Register.contentType); | ||
res.end(Register.metrics()); | ||
}); | ||
}; | ||
|
||
static startCollection(app: express.Express) { | ||
console.log(`Starting the collection of metrics, the metrics are available on :${port}/metrics`); | ||
collectDefaultMetrics(); | ||
app.listen(port); | ||
}; | ||
} | ||
} | ||
|
||
static startCollection(app: express.Express) { | ||
console.log(`Starting the collection of metrics, the metrics are available on :${port}/metrics`) | ||
collectDefaultMetrics() | ||
app.listen(port) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.