Skip to content

Commit

Permalink
Merge branch 'release/v3.8.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
kitce committed Nov 5, 2022
2 parents f53fbee + 40bb526 commit d21e318
Show file tree
Hide file tree
Showing 67 changed files with 2,550 additions and 452 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.7.0
version: 3.8.0
version_files:
- package.json
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
PORT=8080
GOOGLE_ANALYTICS_MEASUREMENT_ID=G-XXXXXXX
GOOGLE_API_KEY=
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_ID=
GOOGLE_GAE_SERVICE_URL=https://your-project-id.region-id.r.appspot.com
4 changes: 2 additions & 2 deletions @types/component.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
declare type TComponentPropsWithoutRef<T extends React.ElementType, P = any> = (
declare type TComponentPropsWithoutRef<T extends React.ElementType, P> = (
Omit<React.ComponentPropsWithoutRef<T>, keyof P>
);

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

### Feat

- **components**: forward ref for `ToggleButton`
- **components**: add `SourcePostScreenshotButton`
- **label-form**: add image button
- **label-form**: change error message to error notification
- **editor**: change error message to error notification
- **label-form**: support screenshot in edit label form
- **helpers**: add `sleep()`
- **subscription**: revise `SubscriptionItem` layout
- **label**: revise `LabelInfo` layout

### Fix

- **label-form**: show screenshot toggle button only when the post is available

### Refactor

- **components**: update tooltip props
- **hooks**: add `useSourcePostScreenshot`
- **components**: spread props
- **components**: destructure and spread the remaining props

## v3.8.0-alpha.2 (2022-11-02)

### Feat

- **label**: support capturing thread title for screenshot
- **label**: remove image enlarge buttons in screenshot
- **auth**: prompt user to select account

### Refactor

- **typings**: update `useGoogleAuthorization`

## v3.8.0-alpha (2022-11-01)

### Feat

- **screenshot**: use proxy for cross-origin images

### Refactor

- **hooks**: update `useScreenshot`

## v3.7.0 (2022-10-21)

### Feat
Expand Down
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pnpm install

For a smooth development experience, you may want to execute the following commands simultaneously:

### Start development
### Start development server

```bash
pnpm dev:main
Expand All @@ -43,16 +43,15 @@ pnpm dev:main
pnpm type:scss[:watch]
```

### Install
### Install development build

When `webpack-dev-server` completed the first compilation, follow these steps to test on [LIHKG](https://lihkg.com/):
1. Start the development server
2. Install [Tampermonkey](https://www.tampermonkey.net/) (or your favourite userscript manager)
3. Visit [http://localhost:8080/libel.proxy.user.js](http://localhost:8080/libel.proxy.user.js)
4. Click **Install**
5. Go back to [LIHKG](https://lihkg.com/) and reload the page

1. Install [Tampermonkey](https://www.tampermonkey.net/) (or your favourite userscript manager)
2. Visit [http://localhost:8080/libel.proxy.user.js](http://localhost:8080/libel.proxy.user.js)
3. Click **Install** / **Reinstall** / **Update**
4. Go back to [LIHKG](https://lihkg.com/) and reload the page

Whenever you made changes and `webpack-dev-server` recompiled the files, repeat step 2 to 4.
Whenever a file has changed, `webpack-dev-server` will recompile the code, and you can simply reload the page to see the changes.

***

Expand All @@ -78,6 +77,8 @@ This project only provides technical support for the [features](https://github.c

[Privacy Policy](https://github.com/kitce/libel/wiki/%E7%A7%81%E9%9A%B1%E6%94%BF%E7%AD%96)

***

## License

MIT License
1 change: 1 addition & 0 deletions config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ export const debugEgg = process.env.EGG === 'true';
export const publicURL = dev ? `http://localhost:${port}` : homepage;
export const publicDataURL = `${publicURL}/${Directory.Data}`;
export const publicDistURL = dev ? publicURL : `${publicURL}/${Directory.Dist}`;
export const imageProxyURL = dev ? `http://localhost:${port + 1}` : process.env.GOOGLE_GAE_SERVICE_URL;
6 changes: 4 additions & 2 deletions config/webpack/plugins/environment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ const {
PORT,
GOOGLE_ANALYTICS_MEASUREMENT_ID,
GOOGLE_API_KEY,
GOOGLE_CLIENT_ID
GOOGLE_CLIENT_ID,
GOOGLE_GAE_SERVICE_URL
} = process.env;

const plugin = new EnvironmentPlugin({
Expand All @@ -13,7 +14,8 @@ const plugin = new EnvironmentPlugin({
PORT,
GOOGLE_ANALYTICS_MEASUREMENT_ID,
GOOGLE_API_KEY,
GOOGLE_CLIENT_ID
GOOGLE_CLIENT_ID,
GOOGLE_GAE_SERVICE_URL
});

export default plugin;
2 changes: 1 addition & 1 deletion dist/egg.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/egg.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion 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.7.0
// @version 3.8.0
// @author kitce <[email protected]>
// @description Label users on LIHKG
// @homepage https://kitce.github.io/libel
Expand Down
4 changes: 2 additions & 2 deletions dist/libel.user.js

Large diffs are not rendered by default.

5 changes: 3 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.7.0",
"version": "3.8.0",
"description": "Label users on LIHKG",
"author": "kitce <[email protected]>",
"repository": {
Expand All @@ -20,12 +20,13 @@
"dev": "NODE_ENV=development webpack serve --config ./config/webpack/webpack.config.dev.ts",
"dev:main": "pnpm dev --config-name main",
"dev:egg": "EGG=true pnpm dev --config-name egg",
"proxy": "node proxy/server.js",
"test": "jest",
"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 && cz ch && pnpm build && git add . && git commit --amend --no-edit",
"type:scss": "tsm src/**/*.module.scss --implementation sass --exportType default",
"type:scss": "tsm \"src/**/*.module.scss\" --implementation sass --exportType default",
"type:scss:watch": "pnpm type:scss --watch",
"announce": "ts-node scripts/generate-announcement.ts"
},
Expand Down
17 changes: 17 additions & 0 deletions proxy/.gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# This file specifies files that are *not* uploaded to Google Cloud
# using gcloud. It follows the same syntax as .gitignore, with the addition of
# "#!include" directives (which insert the entries of the given .gitignore-style
# file at that point).
#
# For more information, run:
# $ gcloud topic gcloudignore
#
.gcloudignore
# If you would like to upload your .git directory, .gitignore file or files
# from your .gitignore file, remove the corresponding line
# below:
.git
.gitignore

# Node.js dependencies:
node_modules/
1 change: 1 addition & 0 deletions proxy/app.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
runtime: nodejs16
Loading

0 comments on commit d21e318

Please sign in to comment.