Skip to main content

JSONP Configuration System

Oidis projects use a JSONP-based configuration system instead of standard package.json. The package.conf.jsonp file at the project root is the source of truth for project identity, dependencies, and build settings.

What Is JSONP?​

JSONP (JSON with Padding) wraps JSON data in a function call:

// Data format (model/entity data)
Io.Oidis.Services.DAO.Resources.Data({
// JSON content
})

// Config format (builder/project config)
Io.Oidis.Builder.DAO.Resources.Data({
// JSON content
})

This wrapper enables the Oidis Builder to process configurations programmatically while supporting features that plain JSON can't — like comments, composition, and template variables.

package.conf.jsonp​

The main configuration file defines everything about a project:

Io.Oidis.Builder.DAO.Resources.Data({
project: {
name: "io-oidis-yourproject",
version: "26.1.0",
author: "Oidis",
license: "BSD-3-Clause",
repository: "https://gitlab.com/oidis/solutions/io-oidis-yourproject"
},
dependencies: {
"io-oidis-hub-gui": "git+https://gitlab.com/oidis/io-oidis-hub-gui.git",
"io-oidis-hub": "git+https://gitlab.com/oidis/io-oidis-hub.git"
// ... other Oidis dependencies (git URLs, not npm)
},
loaderClass: "Io.Oidis.YourProject.Loader",
guiLoaderClass: "Io.Oidis.YourProject.Gui.Loader",
imports: [
"bin/project/configs/bootstrap.jsonp",
"bin/project/configs/sentry.jsonp"
],
target: {
// Build target settings
},
solutions: {
// Build variants
}
})

Key Properties​

PropertyDescription
project.namePackage name (io-oidis-* format)
project.versionVersion number (year.quarter.release)
dependenciesOidis packages as git URLs
loaderClassBackend Loader namespace
guiLoaderClassFrontend Loader namespace
importsFeature config files to merge
targetBuild output settings
solutionsBuild variants (static, shared, etc.)

Template Variables​

JSONP configs support template variables resolved at build time:

{
title: "<? @var project.name ?>",
footer: "Copyright <? @var build.year ?> Oidis"
}
VariableValue
<? @var build.timestamp ?>Build timestamp
<? @var build.year ?>Build year
<? @var project.version ?>Version from package.conf.jsonp
<? @var project.name ?>Project name
<? @var properties.packageName ?>Package name
<? @var properties.loaderPath ?>Path to loader

Template variables also work in HTML files and can be used at runtime on the backend.

Two Composition Mechanisms​

extendsConfig — Vertical Inheritance (1:1)​

A config file inherits all properties from a parent and can override or extend them:

// bin/project/configs/commons.jsonp
Io.Oidis.Builder.DAO.Resources.Data({
extendsConfig: "dependencies/io-oidis-hub/bin/project/configs/commons.jsonp",
// Override or add properties
database: {
port: 27018,
name: "IoOidisYourProjectDev"
}
})

The chain flows downward through the dependency tree:

io-oidis-commons/commons.jsonp
← io-oidis-hub/commons.jsonp (extends parent)
← io-oidis-yourproject/commons.jsonp (extends parent)

Each level inherits everything from its parent and can override specific values.

imports — Horizontal Composition (N:1)​

Multiple config modules are merged into the main config:

// In package.conf.jsonp
{
imports: [
"bin/project/configs/bootstrap.jsonp",
"bin/project/configs/graphiql.jsonp",
"bin/project/configs/pdfPrint.jsonp",
"bin/project/configs/sentry.jsonp"
]
}

Each imported file adds specific features — resources, request patterns, CSP policies, license entries, npm dependencies. They're merged into the main configuration tree.

When to use which:

MechanismRelationshipUse Case
extendsConfigParent → Child (1:1)Config inheritance across dependency layers
importsFeature → Main (N:1)Adding modular features to a project

What the Builder Generates​

The Builder reads package.conf.jsonp, resolves all extendsConfig and imports recursively, merges them into one tree, and generates:

Generated FileSource
package.jsonMerged nodejsConfig.devDependencies from all config layers
tsconfig.jsonDependency tree → paths aliases
webpack.config.jsSASS alias resolution
.gitignorePartially generated (manual section at end)
SW-Content-Register.txtSoftware Content Register from licensesRegister.jsonp
Generated files

These root files have a "WARNING THIS IS GENERATED FILE" comment. Never edit them manually — your changes will be overwritten on the next oidis install.

Config Types in bin/project/configs/​

Config TypePurpose
commons.jsonpRuntime config (domain, DB, auth, email, etc.). Chains via extendsConfig
licensesRegister.jsonpSCR license entries. Chains via extendsConfig
package.conf.schema.jsonpValidation schema for commons. Extends parent schema
Feature configs (bootstrap, graphiql, pdfPrint...)Modular — add resources, CSP, licenses, CDI deps

See also: Runtime Configuration | Build Solutions | Architecture Overview