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
| Property | Description |
|---|---|
project.name | Package name (io-oidis-* format) |
project.version | Version number (year.quarter.release) |
dependencies | Oidis packages as git URLs |
loaderClass | Backend Loader namespace |
guiLoaderClass | Frontend Loader namespace |
imports | Feature config files to merge |
target | Build output settings |
solutions | Build 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"
}
| Variable | Value |
|---|---|
<? @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:
| Mechanism | Relationship | Use Case |
|---|---|---|
extendsConfig | Parent → Child (1:1) | Config inheritance across dependency layers |
imports | Feature → 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 File | Source |
|---|---|
package.json | Merged nodejsConfig.devDependencies from all config layers |
tsconfig.json | Dependency tree → paths aliases |
webpack.config.js | SASS alias resolution |
.gitignore | Partially generated (manual section at end) |
SW-Content-Register.txt | Software Content Register from licensesRegister.jsonp |
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 Type | Purpose |
|---|---|
commons.jsonp | Runtime config (domain, DB, auth, email, etc.). Chains via extendsConfig |
licensesRegister.jsonp | SCR license entries. Chains via extendsConfig |
package.conf.schema.jsonp | Validation 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