Skip to content

Commit

Permalink
Merge pull request #82 from artem-solovev/release/8_2_1
Browse files Browse the repository at this point in the history
Release/8 2 1
  • Loading branch information
kas-elvirov authored Feb 2, 2020
2 parents 3b72313 + fc129ec commit 886b8ef
Show file tree
Hide file tree
Showing 16 changed files with 269 additions and 36 deletions.
16 changes: 14 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
### 8.2.1 @ 2020-02-02 00:00
- optimizations
- bundle size. From 627KB to 132KB
- removed jQuery
- webpack optimizations
- new features
- LOC on liked repos
- design fixes
- bugfix
- fixed LOC for pinned page
- fixed LOC for organization page

### 8.2.0 @ 2020-01-22 00:00
- LOC for main user page (pinned repos)
- new design
Expand All @@ -12,7 +24,7 @@
- feature/#52: style separating for loc messages
- documentation update
- added support for next languages:
- - Bulgarian
- - Polish
- Bulgarian
- Polish
- versions bumping for: jquery, tar, fstream, js-yaml, lodash, mixin-deep
- refactoring
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,18 @@ ___

## History
### Version:
- current: 8.2.0 ( 2020, 22 january )
- current: 8.2.1 ( 2020, 02 february )
- initial: 2.0.1 ( 2017, 12 february )

I made this program in the Russian Army while I was on duty. I was coding as fast as i could )))

## Description
Works for **public** and **private** repos.
Counts lines of code in:
- project detail page ([check it out](https://github.com/torvalds/linux))
- user's pinned repos ([check it out](https://github.com/torvalds))
- user's repositories ([check it out](https://github.com/torvalds?tab=repositories))
- user's liked repositories ([check it out](https://github.com/torvalds?tab=stars))
- project detail page ([check it out](https://github.com/torvalds/linux))
- organization page ([check it out](https://github.com/facebook))
- search results page ([check it out](https://github.com/search?q=react))
- trending page ([check it out](https://github.com/trending))
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"short_name": "__MSG_shortName__",
"author": "__MSG_author__",
"description": "__MSG_description__",
"version": "8.2.0",
"version": "8.2.1",

"browser_action": {
"default_icon": "img/icon128.png",
Expand Down
13 changes: 12 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{
"name": "gloc",
"version": "8.2.0",
"version": "8.2.1",
"description": "Extension counts the number of lines of code in GitHub pages.",
"main": "index.js",
"scripts": {
"pack": "webpack",
"pack:dev": "webpack --config webpack.config.prod",
"pack:prod": "webpack --config webpack.config.dev",
"zip": "grunt",
"build": "webpack && grunt"
"build:prod": "webpack --config webpack.config.prod && grunt",
"build:dev": "webpack --config webpack.config.dev && grunt"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -41,6 +43,7 @@
"grunt-contrib-compress": "^1.4.3",
"html-loader": "^0.5.5",
"html-webpack-plugin": "^3.2.0",
"node-json-minify": "^1.0.0",
"react-iframe": "^1.8.0",
"ts-loader": "^5.3.3",
"tslint": "^5.14.0",
Expand All @@ -56,7 +59,7 @@
"@types/react": "^16.9.13",
"@types/react-dom": "^16.9.4",
"@types/styled-components": "^4.4.0",
"jquery": "^3.4.0",
"pjax": "^0.2.8",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"styled-components": "^4.4.1"
Expand Down
13 changes: 10 additions & 3 deletions src/configs/parametersToMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const parametersToMap: ParameterToMap[] = [
{
locationName: LOCATION.USER,
selector: 'querySelectorAll',
pathToSelect: '#user-repositories-list h3 a',
pathToSelect: '.js-pinned-items-reorder-container ol li a.text-bold.flex-auto.min-width-0',
existenceChecker: (entity: HTMLAnchorElement[]) => entity && entity.length > 0,
wrapper: (entity) => Array.prototype.slice.call(entity),
},
Expand All @@ -38,7 +38,7 @@ export const parametersToMap: ParameterToMap[] = [
{
locationName: LOCATION.SINGLE,
selector: 'querySelector',
pathToSelect: '.experiment-repo-nav h1 strong a',
pathToSelect: '.application-main h1 strong a',
existenceChecker: (entity: HTMLAnchorElement[]) => Boolean(entity),
wrapper: (entity: HTMLAnchorElement) => [entity],
},
Expand All @@ -61,7 +61,14 @@ export const parametersToMap: ParameterToMap[] = [
{
locationName: LOCATION.PINNED_REPOS,
selector: 'querySelectorAll',
pathToSelect: 'form ol li a.text-bold',
pathToSelect: '#user-repositories-list ul li h3 a',
existenceChecker: (entity: HTMLAnchorElement[]) => entity && entity.length > 0,
wrapper: (entity) => Array.prototype.slice.call(entity),
},
{
locationName: LOCATION.LIKED_REPOS,
selector: 'querySelectorAll',
pathToSelect: '.page-profile h3 a',
existenceChecker: (entity: HTMLAnchorElement[]) => entity && entity.length > 0,
wrapper: (entity) => Array.prototype.slice.call(entity),
},
Expand Down
6 changes: 3 additions & 3 deletions src/inject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* Licensed GPL-2.0 © Artem Solovev
*/
import * as $ from 'jquery';
import 'pjax';

import { log } from './utils/log';
import { renderLocs } from './utils/renderLocs';
Expand All @@ -27,9 +27,9 @@ let githubToken: string = '';

gloc();

$(document).on('pjax:complete', () => {
document.addEventListener('pjax:complete', () => {
gloc();
});
})
});
})();

Expand Down
30 changes: 30 additions & 0 deletions src/modules/Common/components/Anchor/Anchor.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import * as React from 'react';
import styled, { css } from 'styled-components';

import { Props } from './index';

const _Anchor = styled.a`
color: ${props => props.color || ''};
`;

export default class Anchor extends React.PureComponent<Props> {
render() {
const {
children,
color,
href,
target,
} = this.props;

const anchorProps = {
href,
target,
};

return (
<_Anchor {...anchorProps} color={color}>
{children}
</_Anchor>
);
}
}
2 changes: 2 additions & 0 deletions src/modules/Common/components/Anchor/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { default as Anchor } from './Anchor';
export { Props } from './types';
6 changes: 6 additions & 0 deletions src/modules/Common/components/Anchor/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export interface Props {
children: string,
href: string,
target?: '_blank',
color?: string,
};
4 changes: 0 additions & 4 deletions src/modules/Common/components/Text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ const _Text = styled.span`
export default class Text extends React.PureComponent<Props> {
render() {
const { children, color } = this.props;

if (typeof children !== 'string') {
return null;
}

return (
<_Text color={color}>
Expand Down
33 changes: 21 additions & 12 deletions src/modules/Popup/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import * as React from 'react';
import Iframe from 'react-iframe';

import { colors } from '../../../../theme/colors';
import {
Container,
Row,
Column,
Center,
} from '../../../Common/components/Layout/index';
import { Text } from '../../../Common/components/Text/index';
import { Anchor } from '../../../Common/components/Anchor/index';


import { decorationProps } from './index';

Expand All @@ -28,24 +32,29 @@ export default class Footer extends React.PureComponent {

<Row>
<Center>
<p>
<a
href="https://goo.gl/forms/uWbvB9tsbOrbaXmz2"
target="_blank"
>
{linkMsg}
</a>
</p>
<Iframe
src="https://ghbtns.com/github-btn.html?user=artem-solovev&repo=gloc&type=star&count=true"
{...decorationProps.githubFrame}
/>
</Center>
</Row>

<Row>
<Center>
<Anchor
href="https://goo.gl/forms/uWbvB9tsbOrbaXmz2"
target="_blank"
color={colors.grey900}
>
{linkMsg}
</Anchor>
</Center>

</Row>

<Row>
<Center>
<Iframe
src="https://ghbtns.com/github-btn.html?user=artem-solovev&repo=gloc&type=star&count=true"
{...decorationProps.githubFrame}
/>
<Text>Made by <Anchor href="http://artemsolovev.com/" target="_blank" color={colors.pink400}>Artem Solovev</Anchor></Text>
</Center>
</Row>
</Column>
Expand Down
3 changes: 3 additions & 0 deletions src/modules/Popup/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export default class Footer extends React.PureComponent {
width='50'
style={{
verticalAlign: 'middle',
marginRight: '2px',
}}
/>

Expand All @@ -40,7 +41,9 @@ export default class Footer extends React.PureComponent {
<Text color={colors.pink400}>
{gloc}
</Text>

</Header>
<Text>Version: 8.2.1</Text>
</Column>

<Column>
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface InitialData {
export enum LOCATION {
USER = 'USER',
PINNED_REPOS = 'PINNED_REPOS',
LIKED_REPOS = 'LIKED_REPOS',
ORGANIZATION = 'ORGANIZATION',
SEARCH = 'SEARCH',
SINGLE = 'SINGLE',
Expand Down
Loading

0 comments on commit 886b8ef

Please sign in to comment.