0.7.0-beta.1 • Published 3 months ago

@elglogins/enterspeed-contrib-js-schemas v0.7.0-beta.1

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

Intro

JavaScript schemas are currently in preview.

With JavaScript schemas, you can build your schemas in a standard language most developers are already familiar with. This means that you have all the power and flexibility from JavaScript available when you are creating your schemas.

This types package goal is to improve developers experience while working with Enterspeed schemas, by providing types to be used by intellisense.

https://docs.enterspeed.com/reference/js/Intro

How to use this package for local schemas development?

  1. Install package
npm i @elglogins/enterspeed-contrib-js-schemas
  1. Configure jsconfig.json
{
    "compilerOptions": {
        "strict": true,
        "allowJs": true,
        "checkJs": true,
        "moduleResolution": "node",
        "noEmit": true,
        "target": "ESNext",
        "types": [
            "@elglogins/enterspeed-contrib-js-schemas"
        ]
    },
}
  1. Decorate your export object with corresponding schema type
/** @type {Enterspeed.FullSchema} */
export default {
  triggers: function(context) {
    context.triggers('umbraco', ['page', 'article']);
  },
  actions: function(sourceEntity, context) {
    context.reprocess('anotherSchema').bySchema();
    context.destination('algolia');
  },
  routes: (sourceEntity, context) => context.url(sourceEntity.url),
  properties: function (sourceEntity, context) {
    const p = sourceEntity.properties;
    return {
      title: p.title,
      blocks: context.partial("blocks", p.blocks),
      aboutUsPage: context.reference("page").children('type eq `product`').orderBy({direction: 'asc', propertyName: 'asd' }).limit(2),
    }
  }
}

Bundling guide

npm run publish-locally
local-package-publisher -p
npm link @elglogins/enterspeed-contrib-js-schemas
npm publish --access public

Watcher

npm run watch
0.7.0-beta.1

3 months ago

0.6.0-beta.3

3 months ago

0.6.0

3 months ago

0.6.0-beta.2

4 months ago

0.6.0-beta.1

5 months ago

0.5.1

5 months ago

0.6.0-beta.0

5 months ago

0.5.0

5 months ago

0.4.0

6 months ago

0.3.3

8 months ago

0.3.2

8 months ago

0.3.1

9 months ago

0.3.0

9 months ago

0.2.4

9 months ago

0.2.3

9 months ago

0.2.2

9 months ago

0.2.1

9 months ago

0.2.0

9 months ago

0.1.6

9 months ago

0.1.5

9 months ago

0.1.4

9 months ago

0.1.3

9 months ago

0.1.2

9 months ago

0.1.1

9 months ago

0.1.0

9 months ago