Skip to content

Commit 4545eca

Browse files
committed
0.2.0
1 parent 9b28259 commit 4545eca

File tree

8 files changed

+55
-11
lines changed

8 files changed

+55
-11
lines changed

.github/workflows/release.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: "release"
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
release:
10+
runs-on: "ubuntu-latest"
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: "marvinpinto/action-automatic-releases@latest"
15+
with:
16+
repo_token: "${{ secrets.PAT }}"
17+
prerelease: false

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11

22
# About
33

4-
| Author | Jane Doe<br>email: [jane@doe.com](mailto:jane@doe.com) |
4+
| Author | Oleg Valter<br>[oleg.a.valter@gmail.com](mailto:oleg.a.valter@gmail.com) |
55
| :----------- | :----------------------- |
6-
| Name | @userscripters/template |
7-
| Description | template repository for userscripters' projects |
6+
| Contributors | |
7+
| Name | @userscripters/stackexchange-helpers |
8+
| Description | Various helpers for interacting with the Stack Exchange network |
89
| License | [GPL-3.0-or-later](https://spdx.org/licenses/GPL-3.0-or-later) |
9-
| Version | 1.0.0 |
10+
| Version | 0.2.0 |
1011

1112
# Support
1213

13-
Bug reports for the project should be [submitted here](https://github.com/userscripters/template/issues).
14+
Bug reports for the project should be [submitted here](https://github.com/userscripters/stackexchange-helpers/issues).
1415
<br>Before adding a new one, please check if it hasn't been raised before.
1516

dist/editing/submit.js

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
export const submitEdit = async (site, postId, postHash, body, title, tags, comment, onError = console.log) => {
2+
try {
3+
const res = await fetch(`${site}/posts/${postId}/edit-submit/${postHash}`, {
4+
method: "POST",
5+
headers: {
6+
"Content-Type": "application/x-www-form-urlencoded",
7+
},
8+
body: new URLSearchParams({
9+
"edit-comment": comment,
10+
"fkey": StackExchange.options.user.fkey,
11+
"is-current": "true",
12+
"post-text": body,
13+
"tagnames": tags.join(" "),
14+
title,
15+
}),
16+
});
17+
return res.status === 200;
18+
}
19+
catch (error) {
20+
onError(error);
21+
return false;
22+
}
23+
};

dist/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import { submitEdit } from "./editing/submit";
2+
export { submitEdit };

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@userscripters/stackexchange-helpers",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "Various helpers for interacting with the Stack Exchange network",
55
"scripts": {
66
"test": "cross-env TS_NODE_PROJECT=test/tsconfig.json mocha -r ts-node/register",
@@ -9,6 +9,7 @@
99
"prebuild": "npm run lint && npm run clean",
1010
"build": "npm run prebuild && tsc",
1111
"readme": "generate-readme",
12+
"version": "npm run test && npm run build",
1213
"postversion": "bash ./scripts/postversion.sh"
1314
},
1415
"repository": {

scripts/postversion.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
declare version=$(printenv | grep -e "npm_package_version" | tail -c 6)
44

5-
npm run build &&
5+
generate-readme &&
66
git commit --all --no-edit --amend &&
77
git tag -af $(git tag --list | tail -n 1) -m "bumped version to $version"

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import { EditSubmitter } from "./editing/submit";
1+
import { submitEdit } from "./editing/submit";
22

3-
export { EditSubmitter };
3+
export { submitEdit };

0 commit comments

Comments
 (0)