Skip to content

Commit f007603

Browse files
committed
Adding MONOLITHIC_CODE mode
1 parent 82a36b8 commit f007603

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

entrypoint.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,7 @@ function creatFileOrPatch(filePath, newFileData, encoding, config) {
2828
"server-input.mustache",
2929
"function-input.mustache",
3030
"index-src.mustache",
31-
"tests.spec.mustache",
32-
"webpack.config.mustache",
33-
"webpack.config.layer.mustache",
34-
"docker-entrypoint.mustache",
35-
"Dockerfile.mustache"
31+
"tests.spec.mustache"
3632
]
3733
if (config.ignores) {
3834
config.ignores.split(';').forEach(function (ignore) {
@@ -402,8 +398,17 @@ function mainProcessor(typeDefs, schema, projectInfo) {
402398
argv.verbose && console.log(`* GraphQL Server: ${server.Name}...`)
403399
let dataSources = rootObject.DataSources.filter(ds => ds.Definition.includes(server.Definition))
404400
dataSources = transformer.convertToArrayWithNotation(dataSources)
401+
let serverFunctions = []
402+
rootObject.Functions.map(f => {
403+
if (f.Servers.find(s => {
404+
return s.ServerName == server.Name
405+
})) {
406+
serverFunctions.push(f)
407+
}
408+
})
409+
serverFunctions = transformer.convertToArrayWithNotation(serverFunctions)
405410
gqlConfig.GraphQLServers.map(cfg => {
406-
writeTemplateFile(`${templates}/${cfg.input}`, { ...projectInfo, ...server, ServerName: server.Name, Functions: rootObject.Functions, DataSources: dataSources, GRAPHQL_USER_DEFINITIONS: schema }, outputDir, cfg.output, projectInfo.WriteConfig)
411+
writeTemplateFile(`${templates}/${cfg.input}`, { ...projectInfo, ...server, ServerName: server.Name, Functions: serverFunctions, DataSources: dataSources, GRAPHQL_USER_DEFINITIONS: schema }, outputDir, cfg.output, projectInfo.WriteConfig)
407412
})
408413
rootObject.DataObjects.map(data => {
409414
argv.verbose && console.log(` Data Object: ${data.Name}...`)

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "simplify-graphql",
3-
"version": "0.1.32",
3+
"version": "0.1.33",
44
"description": "Simplify graphql-serverless architecture model (GSAM)",
55
"main": "entrypoint.js",
66
"bin": {
@@ -34,7 +34,7 @@
3434
"hogan.js": "^3.0.2",
3535
"mkdirp": "^1.0.4",
3636
"readline-sync": "^1.4.10",
37-
"simplify-templates": "^0.1.37",
37+
"simplify-templates": "^0.1.39",
3838
"uuid": "^8.1.0",
3939
"dotenv": "8.2.0"
4040
}

0 commit comments

Comments
 (0)