Skip to content

Commit

Permalink
Merge pull request #154 from Funfunz/release/0.23.0
Browse files Browse the repository at this point in the history
Release/0.23.0
  • Loading branch information
JWebCoder authored Aug 7, 2023
2 parents 1448dbf + c16c932 commit 155d516
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 31 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.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@funfunz/core",
"version": "0.23.0",
"version": "0.23.1",
"description": "backoffice generator",
"exports": {
"./lib/index.js": "./lib/index.js"
Expand Down
8 changes: 0 additions & 8 deletions src/middleware/dataConnector/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ export const initDataConnectors = (funfunz: Funfunz): void => {
)
}

export const stopDataConnectors = (): void => {
Object.entries(connectors).forEach(
([key]) => {
connectors[key].stop()
}
)
}

export const query = (connectorName: string, args: IQueryArgs): Promise<unknown[] | unknown> => {
return connectors[connectorName].query(args)
}
Expand Down
5 changes: 0 additions & 5 deletions src/middleware/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { IFunfunzConfig } from './types.js'
import { execute, ExecutionResult, GraphQLSchema, parse } from 'graphql'
import { isPromise } from './utils/index.js'
import { SchemaManager } from './graphql/manager.js'
import { stopDataConnectors } from './dataConnector/index.js'

export * from './types.js'
export class Funfunz {
Expand Down Expand Up @@ -48,10 +47,6 @@ export class Funfunz {
this.middleware = (new ExpressMiddleware(this)).express
}

public stopDataConnectors(): void {
stopDataConnectors()
}

public static executeGraphQL(schema: GraphQLSchema, document: string, context?: unknown): Promise<ExecutionResult> {
const result = execute({
schema,
Expand Down
3 changes: 2 additions & 1 deletion src/test/api.test.executable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ const application = new Funfunz({
}
}
}).middleware
const authApplication = authenticatedServer(application)
const authPort = 4052
const authApplication = authenticatedServer(application, authPort)

let familyTestName = 'TestFamily'

Expand Down
3 changes: 1 addition & 2 deletions src/test/api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Funfunz } from '../middleware/index.js'
import config from './configs/config.js'
import entities from './configs/entities.js'
import axios from 'axios'
import { authenticatedServer, closeConnections, server, stopDataConnectors } from './utils.js'
import { authenticatedServer, closeConnections, server } from './utils.js'

let randomNumberCount = 4

Expand Down Expand Up @@ -73,7 +73,6 @@ test('api', async (t) => {
t.after(async () => {
await new Promise(
(res) => {
stopDataConnectors([authFunfunz, simpleFunfunz])
closeConnections([authApplication, application], res)
}
)
Expand Down
15 changes: 15 additions & 0 deletions src/test/generatedConfigsMysql/MCsettings.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import familiesModel from './models/families'
import imagesModel from './models/images'
import productsModel from './models/products'
import rolesModel from './models/roles'
import usersModel from './models/users'
import usersrolesModel from './models/usersroles'

export default [
familiesModel,
imagesModel,
productsModel,
rolesModel,
usersModel,
usersrolesModel,
]
3 changes: 1 addition & 2 deletions src/test/graphql.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import test from 'node:test'
import assert from 'node:assert'
import config from './configs/config.js'
import entities from './configs/entities.js'
import { authenticatedServer, closeConnections, server, stopDataConnectors } from './utils.js'
import { authenticatedServer, closeConnections, server } from './utils.js'
import axios from 'axios'

let funfunzInstance
Expand Down Expand Up @@ -36,7 +36,6 @@ test('graphql', async (t) => {
t.after(async () => {
await new Promise(
(res) => {
stopDataConnectors([funfunzInstance])
closeConnections([authApplication, simpleApplication], res)
}
)
Expand Down
8 changes: 0 additions & 8 deletions src/test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@ export function server(funfunz: Express, port: number): Server {
return server.listen(port)
}

export function stopDataConnectors(instances: Funfunz[]) {
instances.forEach(
(instance) => {
instance.stopDataConnectors()
}
)
}

export function closeConnections(servers: Server[], cb: (boolean) => void) {
if (servers.length === 0) {
return
Expand Down
2 changes: 0 additions & 2 deletions src/types/connector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ export abstract class DataConnector {
public abstract create(args: ICreateArgs): Promise<unknown[] | unknown>

public abstract remove(args: IRemoveArgs): Promise<number>

public abstract stop(): void

public abstract connection: unknown
}
Expand Down

0 comments on commit 155d516

Please sign in to comment.