@sankei-arc-shared-components/content-source_story-by-id

0.1.0 • Public • Published

Create Content Source is a shared component

How to use it

import { createContentSource } from '@sankei-arc-shared-components/content-source_story-by-id';
import addResizedUrls from '../transforms/image-resizer';
import includedFields from './common/included-fields/story-card';

const { params, resolve } = createContentSource({
  defaultSite: 'sankei',
  includedFields,
});

delete params.website;
delete params.published;

export default {
  schemaName: 'story-card',
  resolve,
  params,
  transform(data) {
    return addResizedUrls(data);
  },
};

Testing & Linting

We are using Jest and XO for testing and linting.

We are using Husky to run a pre-push hook, preventing un-linted or code that fails tests from making it into the repo.

To test: npm test

To lint: npm run lint - This will also fix any simple linter errors automatically.

Readme

Keywords

none

Package Sidebar

Install

npm i @sankei-arc-shared-components/content-source_story-by-id

Weekly Downloads

21

Version

0.1.0

License

ISC

Unpacked Size

8.52 kB

Total Files

5

Last publish

Collaborators

  • sankei.arc