Origami Frontend Components & Services

Origami via npm

If migrating from Bower to npm, please refer to our migration guide.



How to avoid multiple versions of Origami in the dependency tree

There is a tool called is-origami-flat which can be used to report about any Origami packages which are included with more than one version. E.G. Detecting that @financial-times/o-table@6 and @financial-times/o-table@7 are both in the dependency tree.

Below we will set up is-origami-flat to fail a project which has multiple versions of Origami dependencies.

Here is how to use it with an npm/yarn/pnpm project:

  1. Run the package is-origami-flat before npm pack/npm publish/npm install by adding a prepare script to the package.json.
    "prepare": "npx is-origami-flat"

How to get Origami Sass to work

Currently Origami components on npm have the exact same Sass as their Bower counterparts. To get the Sass compiler to work we will need to configure the includePaths of the compiler to look in node_modules and node_modules/@financial-times.

This can usually be done via the .sassrc file, like below:

	"includePaths": [