Name: gcl
Owner: Prisma
Description: ? Type-safe configuration format (similar to JSON/YAML) based on GraphQL with auto-completion and validation
Created: 2017-07-29 16:26:36.0
Updated: 2018-04-23 15:50:14.0
Pushed: 2017-10-01 19:02:19.0
Size: 16
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
GCL is intended to be a type-safe alternative to JSON, YAML (…) based on the input
type syntax of GraphQL
This example shows a configuration DSL for Docker images
Config files have the .gcl
file extension
e: "node:6.10"
s: ["80"]
orks: ["frontend"]
oy: {
plicas: 2
date_config: {
parallelism: 2
start_policy: {
condition: OnFailure
The schema is specified by input
types. The Root
type is the “root” of the configuration schema.
t Root {
age: String
rts: [String!]
tworks: [String!]
pends_on: [String!]
lumes: [String!]
ploy: Deploy
t Deploy {
plicas: Int
date_config: DeployUpdateConfig
start_policy: DeployRestartPolicy
t DeployUpdateConfig {
rallelism: Int
DeployRestartPolicyCondition {
Failure
t DeployRestartPolicy {
ndition: DeployRestartPolicyCondition
rt fs from 'fs'
rt gclToJson from 'gcl-lib'
c function run() {
nst schema = fs.readFileSync('schema.graphql', 'utf-8')
nst config = fs.readFileSync('config.gcl', 'utf-8')
nst json = await gclToJson(config, schema)
nsole.log(JSON.stringify(json, null, 2))
)
m install -g gcl-lib
l-json -s schema.graphql -c config.gcl