Skip to content

Commit

Permalink
fix: deps
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Jan 16, 2024
1 parent d749545 commit 8dce1be
Show file tree
Hide file tree
Showing 5 changed files with 316 additions and 348 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"express-promise-router": "^4.0.0",
"firebase-admin": "^12.0.0",
"helmet": "^7.0.0",
"js-yaml": "^4.0.0",
"on-finished": "^2.3.0",
"simple-git": "^3.0.3",
"yargs": "^17.0.0"
Expand All @@ -41,7 +40,6 @@
"@naturalcycles/dev-lib": "^13.0.0",
"@sentry/node": "^7.0.0",
"@types/ejs": "^3.0.0",
"@types/js-yaml": "^4.0.0",
"@types/node": "^20.1.0",
"@types/yargs": "^16.0.0",
"fastify": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/db/httpDBRequestHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function httpDBRequestHandler(db: CommonDB): BackendRouter {

// getTableSchema
router.get('/:table/schema', async (req, res) => {
res.json(await db.getTableSchema(req.params['table']!))
res.json(await db.getTableSchema(req.params['table']))
})

// todo: createTable
Expand Down
5 changes: 2 additions & 3 deletions src/deploy/backend.cfg.util.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { StringMap } from '@naturalcycles/js-lib'
import { _readFileSync, AjvSchema, requireFileToExist } from '@naturalcycles/nodejs-lib'
import yaml from 'js-yaml'
import { AjvSchema, fs2, requireFileToExist } from '@naturalcycles/nodejs-lib'
import { resourcesDir } from '../paths.cnst'

export interface BackendCfg {
Expand Down Expand Up @@ -63,7 +62,7 @@ export function getBackendCfg(projectDir: string = '.'): BackendCfg {

const backendCfg: BackendCfg = {
serviceWithBranchName: true,
...(yaml.load(_readFileSync(backendCfgYamlPath)) as any),
...fs2.readYaml(backendCfgYamlPath),
}

backendCfgSchema.validate(backendCfg)
Expand Down
6 changes: 3 additions & 3 deletions src/deploy/deployPrepare.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { _emptyDirSync, _writeFileSync, dimGrey, kpySync } from '@naturalcycles/nodejs-lib'
import { dimGrey, fs2, kpySync } from '@naturalcycles/nodejs-lib'
import { srcDir } from '../paths.cnst'
import { getBackendCfg } from './backend.cfg.util'
import { DeployInfo } from './deploy.model'
Expand Down Expand Up @@ -75,7 +75,7 @@ export async function deployPrepare(opt: DeployPrepareOptions = {}): Promise<Dep
console.log(`1. Copy files to ${dimGrey(targetDir)}`)

// Clean targetDir
_emptyDirSync(targetDir)
fs2.emptyDir(targetDir)

kpySync({
baseDir: defaultFilesDir,
Expand All @@ -94,7 +94,7 @@ export async function deployPrepare(opt: DeployPrepareOptions = {}): Promise<Dep
if (NPM_TOKEN && createNpmrc) {
const npmrcPath = `${targetDir}/.npmrc`
const npmrc = `//registry.npmjs.org/:_authToken=${NPM_TOKEN}`
_writeFileSync(npmrcPath, npmrc)
fs2.writeFile(npmrcPath, npmrc)
}

console.log(`2. Generate ${dimGrey('deployInfo.json')} and ${dimGrey('app.yaml')} in targetDir`)
Expand Down
Loading

0 comments on commit 8dce1be

Please sign in to comment.