Skip to content

Commit

Permalink
fixed errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rajdip-b committed Jul 31, 2024
1 parent 665feba commit 6082a9e
Show file tree
Hide file tree
Showing 9 changed files with 2,678 additions and 2,806 deletions.
6 changes: 4 additions & 2 deletions apps/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"private": false,
"type": "commonjs",
"scripts": {
"build": "swc src --out-dir dist",
"build": "tsc",
"start": "node dist/src/index.js",
"dev": "pnpm build && node dist/src/index.js"
},
Expand All @@ -24,13 +24,15 @@
"figlet": "^1.7.0",
"fs": "0.0.1-security",
"nodemon": "^3.1.4",
"socket.io-client": "^4.7.5"
"socket.io-client": "^4.7.5",
"@keyshade/api-client": "workspace:../../packages/api-client"
},
"devDependencies": {
"@swc/cli": "^0.4.0",
"@swc/core": "^1.6.13",
"@types/cli-table": "^0.3.4",
"@types/figlet": "^1.5.8",
"@types/eccrypto": "^1.1.6",
"@types/node": "^20.14.10",
"eslint-config-standard-with-typescript": "^43.0.1"
}
Expand Down
13 changes: 9 additions & 4 deletions apps/cli/src/util/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import type {
ProjectRootConfig
} from '@/types/index.types'
import { existsSync } from 'fs'
import { readFile, readdir, writeFile } from 'fs/promises'
import { ensureDirectoryExists } from './fileUtils.ts'
import { readFile, readdir, writeFile, mkdir } from 'fs/promises'

export const getOsType = (): 'unix' | 'windows' => {
return process.platform === 'win32' ? 'windows' : 'unix'
Expand Down Expand Up @@ -61,7 +60,6 @@ export const writeProfileConfig = async (
): Promise<void> => {
const path = getProfileConfigurationFilePath()
await ensureDirectoryExists(path)
await ensureDirectoryExists(path)
await writeFile(path, JSON.stringify(config, null, 2), 'utf8')
}

Expand All @@ -70,7 +68,6 @@ export const writePrivateKeyConfig = async (
): Promise<void> => {
const path = getPrivateKeyConfigurationFilePath()
await ensureDirectoryExists(path)
await ensureDirectoryExists(path)
await writeFile(path, JSON.stringify(config, null, 2), 'utf8')
}

Expand All @@ -87,3 +84,11 @@ export const fetchUserRootConfigurationFiles = async (): Promise<string> => {
const files = await readdir(path)
return `- ${files.join('\n- ')}`
}

const ensureDirectoryExists = async (path: string) => {
// Create the parent directory if it doesn't exist
const parentDirectory = path.split('/').slice(0, -1).join('/')
if (!existsSync(parentDirectory)) {
await mkdir(parentDirectory, { recursive: true })
}
}
1 change: 1 addition & 0 deletions apps/cli/src/util/decrypt.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unsafe-argument */
import * as eccrypto from 'eccrypto'

export const decrypt = async (
Expand Down
14 changes: 0 additions & 14 deletions apps/cli/src/util/fileUtils.ts

This file was deleted.

3 changes: 2 additions & 1 deletion apps/cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"@keyshade/api-client": ["../../packages/api-client/src/index.ts"]
},
"incremental": true,
"skipLibCheck": true,
"strictNullChecks": false,
"noImplicitAny": false,
"strictBindCallApply": false,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"noFallthroughCasesInSwitch": true
},
"ts-node": {
"require": ["tsconfig-paths/register"]
Expand Down
1 change: 1 addition & 0 deletions packages/api-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "@keyshade/api-client",
"version": "1.0.0",
"main": "dist/src/index.js",
"description": "This package holds all the API request logic",
"private": true,
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/api-client/tests/environment.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import client from '@package/client'
import EnvironmentController from '@package/controllers/environment/environment'
import client from '@/client'
import EnvironmentController from '@/controllers/environment/environment'

describe('Get Environments Tests', () => {
const email = '[email protected]'
Expand Down
5 changes: 4 additions & 1 deletion packages/api-client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
"noImplicitAny": false,
"strictBindCallApply": false,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true
"noFallthroughCasesInSwitch": true,
"paths": {
"@/*": ["src/*"]
}
},
"include": ["src/**/*.ts", "tests/**/*.ts"],
"exclude": ["node_modules", "dist"]
Expand Down
Loading

0 comments on commit 6082a9e

Please sign in to comment.