0.1.0 • Published 4 years ago

@sankei-arc-shared-components/content-source_story-by-id v0.1.0

Weekly downloads
34
License
ISC
Repository
github
Last release
4 years ago

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.