This article will walk you through the development process of OS.js modules and packages.
Before beginning read the overview article to familiarize yourself with the architecture and involved technologies.
With a standard intallation you get a fully working development environment out of the box.
[info] Note that by default package extensions (applications, themes, etc.) are built separately from your installation/distribution. Make sure to run commands inside the correct directory
If you're using Docker (
docker-compose) for your environment, you have to execute CLI commands within the Docker image context. Example:
docker-compose exec osjs npm run watch
The following list contains the naming convention for modules and packages (in
[warning] Names are unique
osjs-<project>-application- Application package
osjs-<project>-provider- Service Provider module
osjs-<project>-auth- Authentication adapter
osjs-<project>-settings- Settings storage adapter
osjs-<project>-adapter- VFS Adapters
osjs-<project>-theme- Theme package
osjs-<project>-icons- Icons package
osjs-<project>-sounds- Sounds package
osjs-<project>-cli- CLI Plugin
osjs-<project>- Core modules
Official projects are scoped with
@osjs/<project>-<suffix> when published onto npmjs.
If you want to publish a module or package, look at the publish guide.
These are the default provided commands for performing build actions:
npm run buildBuild changes once
npm run watchWatch and build changes automatically
To produce a production build, prefix your command with ex:
NODE_ENV=production npm run <task>.
These are the default provided commands for performing test actions:
npm run test- Run all tests and linters
npm run eslint- ESLint pass
npm run stylelint- Stylelint pass
npm run jest- Jest unit tests
The OS.js client and server are split up into several modules provided by
npm packages (see
To override these modules follow the modules guide.
To make your own module(s), you can use the CLI Wizard:
npm run make:provider- Service Provider - See Service Provider Tutorial
npm run make:auth- Authentication Adapter - See Authentication Tutorial
npm run make:settings- Settings Adapter - See Settings Tutorial
npm run make:vfs- VFS Adapter - See VFS Tutorial
For custom CLI tasks see CLI Guide
Packages are usually installed via
node_modules) but can also be placed into
src/packages. To set up custom package discovery paths, see CLI Guide.
[info] Packages installed in
node_modules/always have the lowest priority, and discovery paths are prioritized by their order (ascending). This means you can replace
npminstalled packages without removing them from
# Create a new application from template npm run make:application # Discover all packages to make it visible in the client npm run package:discover