Skip to content

Commit

Permalink
Merge branch 'release/v3.6.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
kitce committed May 14, 2022
2 parents 52f55aa + 9ee0bb7 commit c741961
Show file tree
Hide file tree
Showing 150 changed files with 1,915 additions and 1,063 deletions.
2 changes: 1 addition & 1 deletion .cz.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ commitizen:
name: cz_conventional_commits
tag_format: v$version
update_changelog_on_bump: true
version: 3.5.0
version: 3.6.0
version_files:
- package.json
16 changes: 13 additions & 3 deletions @types/assets.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,26 @@ declare module '*.png' {
}

declare module '*.svg' {
import type React from 'react';
const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
export default ReactComponent;
const src: string;
export default src;
}

declare module '*.webp' {
const src: string;
export default src;
}

declare module '*.svg?svgr' {
import type React from 'react';
const ReactComponent: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
export default ReactComponent;
}

declare module '*.html' {
const content: string;
export default content;
}

declare module '*.txt' {
const content: string;
export default content;
Expand Down
9 changes: 9 additions & 0 deletions @types/component.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
declare type TComponentPropsWithoutRef<T extends React.ElementType, P = any> = (
Omit<React.ComponentPropsWithoutRef<T>, keyof P>
);

declare type TComponentPropsWithoutRefWithAs<T extends React.ElementType, P = any> = (
TComponentPropsWithoutRef<T, P> & {
as?: T;
}
);
50 changes: 50 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,53 @@
## v3.6.0 (2022-05-15)

### Refactor

- **egg**: add `referenceURL`
- **cloud**: add `Cloud` model
- **apis**: reuse `RequestMethod`
- **editor**: reuse `handleClose`
- **typings**: update component typings
- **typings**: update component typings
- **editor**: update class name
- **hooks**: update `useFadeoutScroll`
- **hooks**: rename `useLazyRender` to `useVisibility`
- **stylesheets**: update variables
- **label-item**: update floating logic
- **helpers/lihkg**: use `DataSet` instead of `Personal`
- **editor**: set dirty earlier
- **components**: move loading spinner from `SettingOptionButton` to `BaseButton`
- **models**: `DataSet``BaseDataSet`; `Custom``DataSet`
- **modal**: add `useModal`
- **hooks**: change `useSettingsModalFocusTrap` to `useFocusTrap`
- **typings**: update hooks types
- **hooks**: update typings and memoization
- **settings**: separate the buttons in `ManageDataSection` into standalone components
- **typings**: update `findReduxStore` typings
- **typings**: update `lihkg` types
- **lihkg**: enhance typings
- **typings**: add type for `unregister()`

### Feat

- **egg**: ***
- **webpack**: allow import HTML
- **apis/lihkg**: update request headers
- **settings**: add convert blocked users button
- **editor**: apply fadeout scroll effect to data set editor
- **apis/lihkg**: add `fetchBlockedUser()`
- **helpers/lihkg**: add `mapBlockedUsersToDataSet()`

### Fix

- **webpack**: cannot import SVGR
- **settings**: remove notifications of cancel clear actions
- **converter**: id collision with existing label
- **label-info**: missing margin-top for buttons

### Perf

- **components**: memoization

## v3.5.0 (2022-04-18)

### Feat
Expand Down
Binary file modified assets/images/831/11.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/831/14.jpg
Binary file not shown.
3 changes: 2 additions & 1 deletion config/webpack/loaders/css-loader.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type webpack from 'webpack';
import { dev } from '../../config';

const loader = {
const loader: webpack.RuleSetUseItem = {
loader: 'css-loader',
options: {
modules: {
Expand Down
4 changes: 3 additions & 1 deletion config/webpack/loaders/postcss-loader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const loader = {
import type webpack from 'webpack';

const loader: webpack.RuleSetUseItem = {
loader: 'postcss-loader'
};

Expand Down
3 changes: 2 additions & 1 deletion config/webpack/loaders/sass-loader.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import sass from 'sass';
import type webpack from 'webpack';

const loader = {
const loader: webpack.RuleSetUseItem = {
loader: 'sass-loader',
options: {
implementation: sass
Expand Down
4 changes: 3 additions & 1 deletion config/webpack/loaders/style-loader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const loader = {
import type webpack from 'webpack';

const loader: webpack.RuleSetUseItem = {
loader: 'style-loader'
};

Expand Down
4 changes: 3 additions & 1 deletion config/webpack/loaders/svg-loader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const loader = {
import type webpack from 'webpack';

const loader: webpack.RuleSetUseItem = {
loader: '@svgr/webpack'
};

Expand Down
4 changes: 3 additions & 1 deletion config/webpack/loaders/ts-loader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const loader = {
import type webpack from 'webpack';

const loader: webpack.RuleSetUseItem = {
loader: 'ts-loader'
};

Expand Down
7 changes: 4 additions & 3 deletions config/webpack/rules/asset.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
import type webpack from 'webpack';
import { dev } from '../../config';
import svgLoader from '../loaders/svg-loader';

export const resource: webpack.RuleSetRule = {
test: /\.(gif|jpg|png|svg|webp)$/i,
type: 'asset/resource',
resourceQuery: { not: /svgr/ },
generator: { emit: false }
};

export const source: webpack.RuleSetRule = {
test: /\.txt$/i,
test: /\.(html|txt)$/i,
type: 'asset/source'
};

export const svg: webpack.RuleSetRule = {
export const svgr: webpack.RuleSetRule = {
test: /\.svg$/i,
issuer: /\.[jt]sx?$/,
resourceQuery: /svgr/,
use: [svgLoader]
};
4 changes: 2 additions & 2 deletions config/webpack/webpack.config.base.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type webpack from 'webpack';
import { publicURL } from '../config';
import environment from './plugins/environment';
import { resource, source, svg } from './rules/asset';
import { resource, source, svgr } from './rules/asset';
import scss from './rules/scss';
import typescript from './rules/typescript';

Expand All @@ -18,7 +18,7 @@ const config: webpack.Configuration = {
rules: [
resource,
source,
svg,
svgr,
scss,
typescript
]
Expand Down
2 changes: 1 addition & 1 deletion config/webpack/webpack.config.dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { dev as main } from './webpack.config.main';

const dev: webpack.Configuration = {
mode: 'development',
devtool: 'eval-cheap-source-map',
devtool: 'eval-source-map',
output: {
path: path.join(process.cwd(), Directory.Build),
}
Expand Down
9 changes: 7 additions & 2 deletions config/webpack/webpack.config.egg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,13 @@ import base from './webpack.config.base';
const devServer: DevServerConfiguration = {
hot: false,
port,
client: false,
liveReload: false,
host: '127.0.0.1',
allowedHosts: 'all',
// client: false,
liveReload: true,
devMiddleware: {
writeToDisk: true
},
headers: {
'Access-Control-Allow-Origin': '*'
},
Expand Down
2 changes: 2 additions & 0 deletions config/webpack/webpack.config.main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import base from './webpack.config.base';
const devServer: DevServerConfiguration = {
hot: false,
port,
host: '127.0.0.1',
allowedHosts: 'all',
client: false,
liveReload: false,
devMiddleware: {
Expand Down
3 changes: 2 additions & 1 deletion config/webpack/webpack.config.prod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ import '../env'; // load the environment variables at the beginning
import path from 'path';
import type webpack from 'webpack';
import merge from 'webpack-merge';
import { Directory } from './../config';
import { Directory } from '../config';
import egg from './webpack.config.egg';
import main from './webpack.config.main';

const prod: webpack.Configuration = {
mode: 'production',
devtool: 'source-map',
output: {
path: path.join(process.cwd(), Directory.Dist)
}
Expand Down
3 changes: 2 additions & 1 deletion dist/egg.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions dist/egg.js.map

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions dist/libel.js.LICENSE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,3 +139,20 @@ PERFORMANCE OF THIS SOFTWARE.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

/** @preserve
* Counter block mode compatible with Dr Brian Gladman fileenc.c
* derived from CryptoJS.mode.CTR
* Jan Hruby [email protected]
*/

/** @preserve
(c) 2012 by Cédric Mesnil. All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
1 change: 1 addition & 0 deletions dist/libel.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/libel.meta.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// ==UserScript==
// @name Libel
// @version 3.5.0
// @version 3.6.0
// @author kitce <[email protected]>
// @description Label users on LIHKG
// @homepage https://kitce.github.io/libel
Expand Down
5 changes: 3 additions & 2 deletions dist/libel.user.js

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "libel",
"namespace": "libel",
"displayName": "Libel",
"version": "3.5.0",
"version": "3.6.0",
"description": "Label users on LIHKG",
"author": "kitce <[email protected]>",
"repository": {
Expand All @@ -25,7 +25,7 @@
"test:watch": "pnpm test -- --watch",
"prebuild": "pnpm clean && pnpm type:scss",
"build": "pnpm prebuild && NODE_ENV=production webpack --config ./config/webpack/webpack.config.prod.ts",
"prerelease": "cz bump && pnpm build && git add . && git commit --amend --no-edit",
"prerelease": "cz bump && cz ch && pnpm build && git add . && git commit --amend --no-edit",
"type:scss": "tsm src/**/*.module.scss --implementation sass --exportType default",
"type:scss:watch": "pnpm type:scss -- --watch"
},
Expand All @@ -38,6 +38,7 @@
"@fortawesome/react-fontawesome": "^0.1.18",
"@reduxjs/toolkit": "^1.5.1",
"classnames": "^2.3.1",
"crypto-js": "^4.1.1",
"date-fns": "^2.27.0",
"debug": "^4.3.3",
"events": "^3.3.0",
Expand All @@ -63,6 +64,8 @@
},
"devDependencies": {
"@svgr/webpack": "^6.2.1",
"@types/chance": "^1.1.3",
"@types/crypto-js": "^4.1.1",
"@types/debug": "^4.1.7",
"@types/gapi": "^0.0.41",
"@types/gapi.auth2": "^0.0.55",
Expand All @@ -81,6 +84,7 @@
"@types/semver": "^7.3.6",
"@types/tailwindcss": "^3.0.10",
"@types/webpack-env": "^1.16.0",
"chance": "^1.1.8",
"css-loader": "^5.2.0",
"cssnano": "^5.1.4",
"dotenv": "^10.0.0",
Expand All @@ -93,6 +97,7 @@
"sass-loader": "^11.0.1",
"style-loader": "^2.0.0",
"tailwindcss": "^3.0.24",
"tiny-typed-emitter": "^2.1.0",
"ts-jest": "^27.1.3",
"ts-key-enum": "^2.0.8",
"ts-loader": "^8.1.0",
Expand Down
Loading

0 comments on commit c741961

Please sign in to comment.