Skip to content
This repository has been archived by the owner on Mar 29, 2021. It is now read-only.

Commit

Permalink
progress on massive maintainability refactor (still needs tests)
Browse files Browse the repository at this point in the history
  • Loading branch information
dsifford committed Dec 22, 2017
1 parent d0ee80b commit 81bf312
Show file tree
Hide file tree
Showing 67 changed files with 2,512 additions and 2,455 deletions.
7 changes: 5 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
{
"plugins": [
"@babel/transform-runtime"
],
"presets": [
"@babel/preset-env",
"@babel/preset-react"
"@babel/env",
"@babel/react"
]
}
5 changes: 5 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
plugins:
phpcodesniffer:
enabled: true
config:
standard: "WordPress"
2 changes: 1 addition & 1 deletion gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export function styles(): NodeJS.ReadWriteStream {
// ==================================================

export function bundle(cb: Callback): void {
const args = IS_PRODUCTION ? ['-p'] : [];
const args = IS_PRODUCTION ? [] : [];
const child = spawn(`${__dirname}/node_modules/.bin/webpack`, args, {
env: process.env,
});
Expand Down
94 changes: 2 additions & 92 deletions lib/types/ABT.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,75 +19,6 @@ declare namespace ABT {
style: 'fixed' | 'toggle';
}

interface ExternalSiteMeta {
authors: Array<{
firstname: string;
lastname: string;
}>;
article: {
/* Facebook URL - not name */
author?: string;
/* ISO Date String */
modified_time?: string;
/* ISO Date String */
published_time?: string;
/* Facebook URL */
publisher?: string;
/* Category or section of source */
section?: string;
/* CSV list of tags */
tag?: string;
};
/* Published Date ISO string */
issued?: string;
og: {
/* Article description */
description?: string;
/* Height of main image in px */
image_height?: string;
/* Width of main image in px */
image_width?: string;
/* urlencoded image url */
image?: string;
/* Site locale */
locale?: string;
/* ISO Date String */
pubdate?: string;
/* Clean URL form of site (e.g. `social.techcrunch.com`) */
site?: string;
/* Title of website */
site_name?: string;
/* Title of Article */
title?: string;
/* Type of posting (generally article) */
type?: string; // tslint:disable-line
/* ISO Date String */
updated_time?: string;
/* URL of page */
url?: string;
};
sailthru: {
/* _usually_ is `firstname lastname` */
author?: string;
/* ISO Date String (issued) */
date?: string;
/* Article description */
description?: string;
/* Full-size image URL */
image_full?: string;
/* Thumbnail image URL */
image_thumb?: string;
/* CSV list of tags */
tags?: string;
/* Title of Article */
title?: string;
};
/* Title of Article - last resort */
title?: string;
/* URL of page */
url?: string;
}

type ContributorType =
| 'author'
| 'container-author'
Expand Down Expand Up @@ -116,30 +47,9 @@ declare namespace ABT {
people: ContributorField[];
}

interface FieldMappings {
bill: FieldMap;
book: FieldMap;
chapter: FieldMap;
legal_case: FieldMap;
'paper-conference': FieldMap;
'entry-encyclopedia': FieldMap;
motion_picture: FieldMap;
speech: FieldMap;
article: FieldMap;
'article-journal': FieldMap;
'article-magazine': FieldMap;
'article-newspaper': FieldMap;
patent: FieldMap;
report: FieldMap;
legislation: FieldMap;
thesis: FieldMap;
broadcast: FieldMap;
webpage: FieldMap;
}
type FieldMappings = { [k in CSL.ItemType]: FieldMap };

interface Contributor extends CSL.Person {
type: ContributorType;
}
type Contributor = CSL.Person & { type: CSL.PersonFieldKey };

interface ManualData {
manualData: CSL.Data;
Expand Down
Loading

0 comments on commit 81bf312

Please sign in to comment.