Skip to content

Commit

Permalink
Merge pull request #8 from KaungWai/feature/keygen_sdkgen_tsnode
Browse files Browse the repository at this point in the history
#7 keygen & sdkgen with ts-node
  • Loading branch information
KaungWai authored Apr 3, 2023
2 parents edf4b73 + 7e588f2 commit 141640a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "kickstart-fastify",
"version": "1.0.1",
"version": "1.0.2",
"description": "",
"main": "index.js",
"_moduleAliases": {
Expand All @@ -13,8 +13,8 @@
"lint": "eslint --fix ./",
"migrate": "prisma migrate dev",
"seed": "prisma db seed",
"keygen": "tsc && node ./dist/scripts/keygen.js",
"sdkgen": "tsc && node ./dist/scripts/sdkgen.js"
"keygen": "ts-node ./scripts/keygen.ts",
"sdkgen": "ts-node ./scripts/sdkgen.ts"
},
"repository": {
"type": "git",
Expand Down
4 changes: 3 additions & 1 deletion scripts/keygen.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import 'module-alias/register'

import { randomBytes } from 'crypto'
import { existsSync, mkdirSync, writeFileSync } from 'fs'
import path from 'path'

const outputFolder = path.join(__dirname, '../../keys')
const outputFolder = path.join(__dirname, '../keys')

const main = () => {
if (!existsSync(outputFolder)) {
Expand Down
8 changes: 5 additions & 3 deletions scripts/sdkgen.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import 'module-alias/register'

import { existsSync, mkdirSync } from 'fs'
import path from 'path'
import { generateApi } from 'swagger-typescript-api'

import build from '../src/app'
import { SYS_CONSTANTS } from '../src/constants/systemConstants'
import build from '@/app'
import { SYS_CONSTANTS } from '@/constants/systemConstants'

const outputFolder = path.join(__dirname, '../../sdk')
const outputFolder = path.join(__dirname, '../sdk')

const main = async () => {
if (!existsSync(outputFolder)) {
Expand Down

0 comments on commit 141640a

Please sign in to comment.