The Qooxdoo tooling and package management systems rely on these configuration files:
Manifest.json
: This mandatory file contains basic information on the library, such as name, namespace, version, dependencies, etc.compile.json
andcompile.js
: These files configure the compiler and are responsible how the build of a project will be structured and what it will contain.qx-lock.json
: This is a library's lockfile which contains information on the version of the dependenciesQooxdoo.json
: serves as a registry of libraries in a package (normally not needed)
Manifest.json
, compile.json
and Qooxdoo.json
are validated against
JSON-schemas
. In contrast, qx-lock.json
is not, and you should not code against the
lockfile's structure, since it can change any time.
You should not read or write the configuration files directly, but use the API instead. This ensures that all the toolchain can automatically validate, and, if necessary and possible, migrate the content automatically.
In the following, this is demonstrated using qx.tool.config.Manifest
. The
other classes are qx.tool.config.Compile
, qx.tool.config.Registry
(for
Qooxdoo.json
) and qx.tool.config.Lockfile
.
- Load the model for the configuration file like so:
const manifestModel = await (qx.tool.config.Manifest.getInstance()).load();
This can be done from anywhere in the code. In non-async code, you need to useqx.tool.config.Manifest.getInstance().load().then(manifestModel => {...});
- Read properties using the
getValue()
method and manipulate the data using thesetValue
,transform()
andunset()
methods. If you change a value outside this API (such as an array item or a subkey of a reference), you must call thevalidate()
method afterwards to ensure that the data is correct. - At the end of the script, check if the model content has changed and, if
yes, store the file's content to disk:
if (manifestModel.isDirty() { manifestModel.save() };
This API is not only useful for Qooxdoo purposes. In fact, you can use it for
your own applications by extending qx.tool.config.Abstract
to write your
own config file models
.
While the configuration is typically read from compile.json
, an API is exposed
by the CLI which allows the configuration to be manipulated before it is
processed and to interact with the compiler as it works.
See api.md for more details.