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

Commit

Permalink
Massive overhaul
Browse files Browse the repository at this point in the history
- convert from styled-jsx to css-modules
- rework directory structure
- extract code into various smaller components
- add fragments where appropriate
- upgrade all dependencies + begin using babel v7 (and friends)
  • Loading branch information
dsifford committed Dec 19, 2017
1 parent 7cc1850 commit d0ee80b
Show file tree
Hide file tree
Showing 130 changed files with 13,778 additions and 25,358 deletions.
6 changes: 4 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
{
"presets": ["env", "react"],
"plugins": ["styled-jsx/babel"]
"presets": [
"@babel/preset-env",
"@babel/preset-react"
]
}
2 changes: 1 addition & 1 deletion .php_cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ return PhpCsFixer\Config::create()
'visibility_required' => true,
'whitespace_after_comma_in_array' => true,
])
->setCacheFile(__DIR__ . '/lib/tmp/.phpcs-cache')
->setCacheFile(__DIR__ . '/node_modules/.cache/.phpcs-cache')
->setHideProgress(false)
->setLineEnding("\n")
->setRiskyAllowed(true)
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
},
"lcov.path": "lib/tmp/coverage/lcov.info",
"lcov.branchCoverage": "full",
"tslint.exclude": ["**/src/**/__tests__/*"]
"tslint.exclude": ["**/src/**/__tests__/*"],
"scss.validate": false
}
35 changes: 21 additions & 14 deletions lib/before-test.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
require('ts-node/register');
const { configure } = require('enzyme');
import { configure } from 'enzyme';
import * as Adapter from 'enzyme-adapter-react-16';
configure({ adapter: new Adapter() });

const { i18n, state, wpInfo } = require('./fixtures.ts');
import { i18n, state, wpInfo } from './fixtures';
const styles = require('../src/vendor/citation-styles.json');

window.ABT = {
state,
i18n,
wp: wpInfo,
styles,
custom_csl: {
label: '',
},
};
configure({ adapter: new Adapter() });

class Storage {
private items = new Map<string, string>();
Expand All @@ -28,4 +18,21 @@ class Storage {
}
}

(<any>window).StorageMock = Storage;
Object.defineProperties(window, {
ABT: {
configurable: true,
writable: true,
value: {
state,
i18n,
wp: wpInfo,
styles,
custom_csl: {
label: '',
},
},
},
StorageMock: {
value: Storage,
},
});
12 changes: 7 additions & 5 deletions lib/types/globals.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,16 @@ interface Window {

// ==============

declare module 'common-tags';
declare module 'focus-trap-react';
declare module 'enzyme-adapter-react-16';
declare module 'gulp-uglify/composer';
declare module 'gulp-wp-pot';
declare module 'react-select-fast-filter-options';
declare module 'react-virtualized-select';
declare module 'rollbar-sourcemap-webpack-plugin';
declare module 'react-select-fast-filter-options';
declare module 'rollbar/dist/rollbar.umd';
declare module 'string-hash';
declare module 'uglify-es';
declare module '*.scss' {
const content: {
[identifier: string]: any;
};
export = content;
}
8 changes: 0 additions & 8 deletions lib/types/modules.d.ts

This file was deleted.

254 changes: 254 additions & 0 deletions lib/types/wordpress.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,257 @@ declare const wp: {
registerBlockType(blockName: string, block: object): void;
};
};

declare namespace WordPress {
type Dashicon =
| 'admin-appearance'
| 'admin-collapse'
| 'admin-comments'
| 'admin-customizer'
| 'admin-generic'
| 'admin-home'
| 'admin-links'
| 'admin-media'
| 'admin-multisite'
| 'admin-network'
| 'admin-page'
| 'admin-plugins'
| 'admin-post'
| 'admin-settings'
| 'admin-site-alt'
| 'admin-site-alt2'
| 'admin-site-alt3'
| 'admin-site'
| 'admin-tools'
| 'admin-users'
| 'album'
| 'align-center'
| 'align-left'
| 'align-none'
| 'align-right'
| 'analytics'
| 'archive'
| 'arrow-down-alt'
| 'arrow-down-alt2'
| 'arrow-down'
| 'arrow-left-alt'
| 'arrow-left-alt2'
| 'arrow-left'
| 'arrow-right-alt'
| 'arrow-right-alt2'
| 'arrow-right'
| 'arrow-up-alt'
| 'arrow-up-alt2'
| 'arrow-up'
| 'art'
| 'awards'
| 'backup'
| 'book-alt'
| 'book'
| 'buddicons-activity'
| 'buddicons-buddypress-logo'
| 'buddicons-community'
| 'buddicons-forums'
| 'buddicons-friends'
| 'buddicons-groups'
| 'buddicons-pm'
| 'buddicons-replies'
| 'buddicons-topics'
| 'buddicons-tracking'
| 'buddipress-bbpress-logo'
| 'building'
| 'businessman'
| 'calendar-alt'
| 'calendar'
| 'camera'
| 'carrot'
| 'cart'
| 'category'
| 'chart-area'
| 'chart-bar'
| 'chart-line'
| 'chart-pie'
| 'clipboard'
| 'clock'
| 'cloud'
| 'controls-back'
| 'controls-forward'
| 'controls-pause'
| 'controls-play'
| 'controls-repeat'
| 'controls-skipback'
| 'controls-skipforward'
| 'controls-volumeoff'
| 'controls-volumeon'
| 'dashboard'
| 'desktop'
| 'dismiss'
| 'download'
| 'edit'
| 'editor-aligncenter'
| 'editor-alignleft'
| 'editor-alignright'
| 'editor-bold'
| 'editor-break'
| 'editor-code'
| 'editor-contract'
| 'editor-customchar'
| 'editor-expand'
| 'editor-help'
| 'editor-indent'
| 'editor-insertmore'
| 'editor-italic'
| 'editor-justify'
| 'editor-kitchensink'
| 'editor-ol'
| 'editor-outdent'
| 'editor-paragraph'
| 'editor-paste-text'
| 'editor-paste-word'
| 'editor-quote'
| 'editor-removeformatting'
| 'editor-rtl'
| 'editor-spellcheck'
| 'editor-strikethrough'
| 'editor-table'
| 'editor-textcolor'
| 'editor-ul'
| 'editor-underline'
| 'editor-unlink'
| 'editor-video'
| 'email-alt'
| 'email-alt2'
| 'email'
| 'excerpt-view'
| 'external'
| 'facebook-alt'
| 'facebook'
| 'feedback'
| 'filter'
| 'flag'
| 'format-aside'
| 'format-audio'
| 'format-chat'
| 'format-gallery'
| 'format-image'
| 'format-quote'
| 'format-status'
| 'format-video'
| 'forms'
| 'googleplus'
| 'grid-view'
| 'groups'
| 'hammer'
| 'heart'
| 'hidden'
| 'id-alt'
| 'id'
| 'image-crop'
| 'image-filter'
| 'image-flip-horizontal'
| 'image-flip-vertical'
| 'image-rotate-left'
| 'image-rotate-right'
| 'image-rotate'
| 'images-alt'
| 'images-alt2'
| 'index-card'
| 'info'
| 'laptop'
| 'layout'
| 'leftright'
| 'lightbulb'
| 'list-view'
| 'location-alt'
| 'location'
| 'lock'
| 'marker'
| 'media-archive'
| 'media-audio'
| 'media-code'
| 'media-default'
| 'media-document'
| 'media-interactive'
| 'media-spreadsheet'
| 'media-text'
| 'media-video'
| 'megaphone'
| 'menu-alt'
| 'menu'
| 'microphone'
| 'migrate'
| 'minus'
| 'money'
| 'move'
| 'nametag'
| 'networking'
| 'no-alt'
| 'no'
| 'palmtree'
| 'paperclip'
| 'performance'
| 'phone'
| 'playlist-audio'
| 'playlist-video'
| 'plus-alt'
| 'plus-light'
| 'plus'
| 'portfolio'
| 'post-status'
| 'pressthis'
| 'products'
| 'randomize'
| 'redo'
| 'rss'
| 'schedule'
| 'screenoptions'
| 'search'
| 'share-alt'
| 'share-alt2'
| 'share'
| 'shield-alt'
| 'shield'
| 'slides'
| 'smartphone'
| 'smiley'
| 'sort'
| 'sos'
| 'star-empty'
| 'star-filled'
| 'star-half'
| 'sticky'
| 'store'
| 'tablet'
| 'tag'
| 'tagcloud'
| 'testimonial'
| 'text'
| 'thumbs-down'
| 'thumbs-up'
| 'tickets-alt'
| 'tickets'
| 'translation'
| 'trash'
| 'twitter'
| 'undo'
| 'universal-access-alt'
| 'universal-access'
| 'unlock'
| 'update'
| 'upload'
| 'vault'
| 'video-alt'
| 'video-alt2'
| 'video-alt3'
| 'visibility'
| 'warning'
| 'welcome-add-page'
| 'welcome-comments'
| 'welcome-learn-more'
| 'welcome-view-site'
| 'welcome-widgets-menus'
| 'welcome-write-blog'
| 'wordpress-alt'
| 'wordpress'
| 'yes';
}
Loading

0 comments on commit d0ee80b

Please sign in to comment.