0.1.0 • Published 6 years ago
@sankei-arc-shared-components/content-source_story-by-id v0.1.0
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.
0.1.0
6 years ago