Skip to content

Commit

Permalink
Publish
Browse files Browse the repository at this point in the history
  • Loading branch information
thedrlambda committed Dec 4, 2024
1 parent 4879ed7 commit e70687e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
## Fixes and improvements
-

# 4.4.1
## Fixes and improvements
- Simulator parsing body correctly
- Don't crash if no arguments

# 4.4.0
## Added features
- Basic local `sim`-ulator
Expand Down
9 changes: 9 additions & 0 deletions Execute.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,15 @@ class Simulator {
start() {
return new Promise((resolve) => {
const app = express();
app.use((req, res, next) => {
if (req.is("multipart/form-data") ||
req.is("application/x-www-form-urlencoded")) {
express.urlencoded({ extended: true, limit: "10mb" })(req, res, next);
}
else {
express.raw({ type: "*/*", limit: "10mb" })(req, res, next);
}
});
const withSession = cookieParser();
app.get("/:event", withSession, (req, res) => {
let event = req.params.event;
Expand Down
10 changes: 10 additions & 0 deletions Execute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,16 @@ class Simulator {
start() {
return new Promise<void>((resolve) => {
const app = express();
app.use((req, res, next) => {
if (
req.is("multipart/form-data") ||
req.is("application/x-www-form-urlencoded")
) {
express.urlencoded({ extended: true, limit: "10mb" })(req, res, next);
} else {
express.raw({ type: "*/*", limit: "10mb" })(req, res, next);
}
});
const withSession: RequestHandler<{ event: string }> = cookieParser();
app.get("/:event", withSession, (req, res) => {
let event = req.params.event;
Expand Down
Binary file modified dist/windows.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { CTRL_C, exit } from "./prompt.js";
import { abort, checkVersion, package_json, setDryrun } from "./utils.js";
process.argv.splice(0, 1); // Remove node
process.argv.splice(0, 1); // Remove index
if (process.argv[0].endsWith("version")) {
if (process.argv.length > 0 && process.argv[0].endsWith("version")) {
console.log(package_json.version);
process.exit(0);
}
Expand Down
2 changes: 1 addition & 1 deletion index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { abort, checkVersion, package_json, setDryrun } from "./utils.js";

process.argv.splice(0, 1); // Remove node
process.argv.splice(0, 1); // Remove index
if (process.argv[0].endsWith("version")) {
if (process.argv.length > 0 && process.argv[0].endsWith("version")) {
console.log(package_json.version);
process.exit(0);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@merrymake/cli",
"version": "4.4.0",
"version": "4.4.1",
"description": "",
"main": "index.js",
"type": "module",
Expand Down

0 comments on commit e70687e

Please sign in to comment.