Skip to content

Installation ​

Install the core and the Atscript toolchain once, then the packages of the host you choose. The Overview helps you choose.

Preview release

The packages are a preview (0.0.x): their APIs may still change between releases.

Requirements ​

  • Node.js 22.12 or newer, for the build and for a Moost server.
  • Atscript 0.2.28 or newer (@atscript/core, @atscript/typescript, unplugin-atscript), Atscript DB 0.1.204 or newer (@atscript/db, @atscript/db-client, @atscript/moost-db) and Atscript UI 0.1.202 or newer. A Moost server needs Moost 0.7.13 and Wooks 0.8.8 or newer. The packages declare these as peer dependencies.
  • An OData v2 or v4 service whose $metadata you can read, once to save it and then at runtime: in the browser with the signed-in user, on the server with its technical user.
  • For the browser client: the service reachable from the page's origin, directly or through a proxy. Most SAP Gateway® systems do not allow cross-origin calls.

Models: every setup ​

The generated .as files use annotations of @atscript/db and @atscript/ui, so the build needs their plugins next to the OData one:

bash
pnpm add @atscript/odata @atscript/core @atscript/typescript @atscript/db @atscript/ui @uniqu/core
pnpm add -D unplugin-atscript

@atscript/odata brings the atscript-odata command that saves a service's $metadata, and the build plugin @atscript/odata/plugin. Its main entry is browser-safe; the plugin entry is Node only. Only unplugin-atscript is build-time: the rest are runtime dependencies. Both hosts use @atscript/db and @atscript/ui, and a Moost server loads @atscript/core (its nav entry, through @atscript/db) and @atscript/typescript from node_modules when it runs, so don't install them with -D.

Configure the plugins in atscript.config.ts as shown in Generating Models, and compile .as files in your bundler with unplugin-atscript. The generated types write a decimal as decimal: declare it once, as Type Safety shows.

Browser client ​

bash
pnpm add @atscript/odata-client @atscript/db-client @atscript/db @atscript/core @atscript/typescript @uniqu/core

The screens come from Atscript UI: install it as its installation guide describes (@atscript/ui, @atscript/vue-table, @atscript/vue-form, @atscript/ui-styles and vunor for Vue). Continue with Browser Client.

Moost Server ​

bash
pnpm add @atscript/moost-odata @atscript/db-odata @atscript/odata \
  @atscript/moost-db @atscript/db @atscript/core @atscript/typescript @uniqu/core \
  moost @moostjs/event-http @wooksjs/event-core @wooksjs/event-http @wooksjs/http-body

The browser side of a Moost server is a plain Atscript DB client: @atscript/db-client and Atscript UI, no OData package. Continue with Moost Server.

Generate on install ​

The generated files are written by builds, never by the editor. Add a prepare script so a fresh checkout has them before the editor or the type checker asks for them:

json
{
  "scripts": {
    "prepare": "asc -f dts"
  }
}

If you commit the generated files instead, commit both the .as file and the model module. See When the files are generated.

Next ​

SAP, SAP S/4HANA, SAP Fiori, SAPUI5, SAP BTP and other SAP products and services mentioned herein, as well as their respective logos, are trademarks or registered trademarks of SAP SE (or an SAP affiliate company) in Germany and other countries. Atscript OData is an independent open-source project and is not affiliated with, sponsored or endorsed by SAP SE.
Released under the MIT License.