Skip to content

Commit

Permalink
Merge pull request #14 from p-society/dev
Browse files Browse the repository at this point in the history
fix: `sed` scripts to fix typefiles
  • Loading branch information
zakhaev26 authored Aug 9, 2024
2 parents 9fb50d9 + f186251 commit bcdb0b9
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"dev": "ts-node-dev --no-notify src/",
"start": "yarn run compile && node lib/",
"mocha": "mocha --require ts-node/register --require source-map-support/register \"test/**/*.ts\" --recursive --exit",
"compile": "shx rm -rf lib/ && tsc",
"compile": "shx rm -rf lib/ && chmod u+rwx ./scripts/decoratorfixer.sh && ./scripts/decoratorfixer.sh && tsc",
"prepare": "husky"
},
"standard": {
Expand Down Expand Up @@ -83,6 +83,7 @@
"husky": "^9.0.11",
"jest": "^29.7.0",
"shx": "^0.3.4",
"socket.io-parser": "^3.3.4",
"ts-jest": "^29.1.2",
"ts-node-dev": "^2.0.0",
"typescript": "^4.7.3"
Expand Down
12 changes: 12 additions & 0 deletions scripts/decoratorfixer.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
$file = ".\node_modules\@feathersjs\hooks\script\hooks.d.ts"
$old_word = "DecoratorContext"
$new_word = "any"
$line_number = 9
$position = 99

$lines = Get-Content -Path $file

if ($lines[$line_number - 1] -match ".*$old_word.*") {
$lines[$line_number - 1] = $lines[$line_number - 1] -replace "\b$old_word\b", $new_word
}
Set-Content -Path $file -Value $lines
10 changes: 10 additions & 0 deletions scripts/decoratorfixer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

#!/bin/bash

file="./node_modules/@feathersjs/hooks/script/hooks.d.ts"
old_word="DecoratorContext"
new_word="any"
line_number=9
position=99

sed -i "${line_number}s/\<${old_word}\>/${new_word}/g" "${file}"
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5812,7 +5812,7 @@ socket.io-client@2.5.0:
socket.io-parser "~3.3.0"
to-array "0.1.4"

socket.io-parser@*, socket.io-parser@~3.3.0:
socket.io-parser@*, socket.io-parser@^3.3.4, socket.io-parser@~3.3.0:
version "3.3.4"
resolved "https://registry.yarnpkg.com/socket.io-parser/-/socket.io-parser-3.3.4.tgz#ab84236b6d06eaf1fb68b179b3a7501195886cc3"
integrity sha512-z/pFQB3x+EZldRRzORYW1vwVO8m/3ILkswtnpoeU6Ve3cbMWkmHEWDAVJn4QJtchiiFTo5j7UG2QvwxvaA9vow==
Expand Down

0 comments on commit bcdb0b9

Please sign in to comment.