-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(deps): Migrate to latest PureScript and Spago
- Loading branch information
1 parent
501cfd9
commit 5868cd3
Showing
12 changed files
with
2,391 additions
and
4,363 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -115,8 +115,8 @@ Finally, when everything succeeds: | |
## Local development | ||
|
||
```shell | ||
$ npm install -g spago@0.9.0 purescript@0.13.3 | ||
$ spago bundle-app -w | ||
$ npm install -g spago@0.20.9 purescript@0.15.7 [email protected] | ||
$ spago bundle-app --platform=node -w | ||
$ npx nodemon index.js | ||
``` | ||
|
||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
{ | ||
"name": "orchy", | ||
"version": "0.6.0", | ||
"description": "a simple web hooks manager with zero npm dependencies", | ||
"keywords": [ | ||
"webhooks", | ||
"hooks", | ||
"server" | ||
], | ||
"main": "index.js", | ||
"repository": "[email protected]:maciejsmolinski/orchy.git", | ||
"author": "Maciej Smolinski <[email protected]>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"purescript": "^0.13.3", | ||
"spago": "^0.20.7" | ||
}, | ||
"scripts": { | ||
"prepublish": "spago bundle-app --main Main --to index.js && printf '%s\n%s' \"#!/usr/bin/env node\" \"$(cat index.js)\" > index.js" | ||
}, | ||
"bin": { | ||
"orchy": "./index.js" | ||
} | ||
"name": "orchy", | ||
"version": "0.6.0", | ||
"description": "a simple web hooks manager with zero npm dependencies", | ||
"keywords": [ | ||
"webhooks", | ||
"hooks", | ||
"server" | ||
], | ||
"main": "index.js", | ||
"type": "module", | ||
"repository": "[email protected]:maciejsmolinski/orchy.git", | ||
"author": "Maciej Smolinski <[email protected]>", | ||
"license": "MIT", | ||
"devDependencies": { | ||
"purescript": "^0.15.7", | ||
"spago": "^0.20.9", | ||
"esbuild": "^0.17.11" | ||
}, | ||
"scripts": { | ||
"prepublish": "spago bundle-app --platform node --main Main --to index.js && printf '%s\n%s' \"#!/usr/bin/env node\" \"$(cat index.js)\" > index.js" | ||
}, | ||
"bin": { | ||
"orchy": "./index.js" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,17 @@ | ||
{ name = | ||
"orchy" | ||
, dependencies = | ||
[ "effect" | ||
, "console" | ||
, "psci-support" | ||
, "generics-rep" | ||
, "arrays" | ||
, "functions" | ||
, "aff" | ||
, "simple-json" | ||
, "strings" | ||
, "spec" | ||
, "node-process" | ||
] | ||
, packages = | ||
./packages.dhall | ||
, sources = | ||
[ "src/**/*.purs", "test/**/*.purs" ] | ||
} | ||
{- | ||
Welcome to a Spago project! | ||
You can edit this file as you like. | ||
Need help? See the following resources: | ||
- Spago documentation: https://github.com/purescript/spago | ||
- Dhall language tour: https://docs.dhall-lang.org/tutorials/Language-Tour.html | ||
When creating a new Spago project, you can use | ||
`spago init --no-comments` or `spago init -C` | ||
to generate this file without the comments in this block. | ||
-} | ||
{ name = "orchy" | ||
, dependencies = [ "console", "effect", "prelude", "spec", "aff", "foreign", "node-process", "simple-json", "arrays", "either", "foldable-traversable", "functions", "lists", "maybe", "strings", "transformers", "tuples" ] | ||
, packages = ./packages.dhall | ||
, sources = [ "src/**/*.purs", "test/**/*.purs" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,30 @@ | ||
function date() { | ||
var currentDate = new Date(); | ||
|
||
return [ | ||
String(currentDate.getDate()).padStart(2, '0'), | ||
String(currentDate.getMonth() + 1).padStart(2, '0'), | ||
String(currentDate.getFullYear()).padStart(4, '0'), | ||
String(currentDate.getHours()).padStart(2, '0'), | ||
String(currentDate.getMinutes()).padStart(2, '0'), | ||
String(currentDate.getSeconds()).padStart(2, '0'), | ||
]; | ||
var currentDate = new Date(); | ||
|
||
return [ | ||
String(currentDate.getDate()).padStart(2, "0"), | ||
String(currentDate.getMonth() + 1).padStart(2, "0"), | ||
String(currentDate.getFullYear()).padStart(4, "0"), | ||
String(currentDate.getHours()).padStart(2, "0"), | ||
String(currentDate.getMinutes()).padStart(2, "0"), | ||
String(currentDate.getSeconds()).padStart(2, "0"), | ||
]; | ||
} | ||
|
||
export function ddmmyyyy() { | ||
var currentDate = date(); | ||
|
||
exports.ddmmyyyy = function() { | ||
var currentDate = date(); | ||
|
||
return currentDate[0] + '/' + currentDate[1] + '/' + currentDate[2]; | ||
return currentDate[0] + "/" + currentDate[1] + "/" + currentDate[2]; | ||
} | ||
|
||
exports.yyyymmdd = function() { | ||
var currentDate = date(); | ||
export function yyyymmdd() { | ||
var currentDate = date(); | ||
|
||
return currentDate[2] + '/' + currentDate[1] + '/' + currentDate[0]; | ||
return currentDate[2] + "/" + currentDate[1] + "/" + currentDate[0]; | ||
} | ||
|
||
exports.hhmmss = function() { | ||
var currentDate = date(); | ||
export function hhmmss() { | ||
var currentDate = date(); | ||
|
||
return currentDate[3] + ':' + currentDate[4] + ':' + currentDate[5]; | ||
return currentDate[3] + ":" + currentDate[4] + ":" + currentDate[5]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,40 @@ | ||
exports.post_ = function(url, payload) { | ||
return function(onError, onSuccess) { | ||
var https = require('https'); | ||
var URL = require('url').URL; | ||
import https from "https"; | ||
import { URL } from "url"; | ||
|
||
var parsedUrl = new URL(url); | ||
var hostname = parsedUrl.hostname; | ||
var path = parsedUrl.pathname + parsedUrl.search; | ||
var port = | ||
parsedUrl.protocol === 'https:' | ||
? '443' | ||
: (parsedUrl.protocol === 'http:' ? 80 : parsedUrl.port); | ||
export function post_(url, payload) { | ||
return function (onError, onSuccess) { | ||
var parsedUrl = new URL(url); | ||
var hostname = parsedUrl.hostname; | ||
var path = parsedUrl.pathname + parsedUrl.search; | ||
var port = | ||
parsedUrl.protocol === "https:" | ||
? "443" | ||
: parsedUrl.protocol === "http:" | ||
? 80 | ||
: parsedUrl.port; | ||
|
||
var request = https.request({ | ||
hostname: hostname, | ||
path: path, | ||
port: port, | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
} | ||
}, function(_) { | ||
onSuccess({}); | ||
}); | ||
var request = https.request( | ||
{ | ||
hostname: hostname, | ||
path: path, | ||
port: port, | ||
method: "POST", | ||
headers: { | ||
"Content-Type": "application/json", | ||
}, | ||
}, | ||
function (_) { | ||
onSuccess({}); | ||
} | ||
); | ||
|
||
request.on('error', onError); | ||
request.write(payload); | ||
request.end(); | ||
request.on("error", onError); | ||
request.write(payload); | ||
request.end(); | ||
|
||
return function(cancelError, onCancelerError, onCancelerSuccess) { | ||
request.abort(); | ||
onCancelerSuccess(); | ||
} | ||
} | ||
return function (cancelError, onCancelerError, onCancelerSuccess) { | ||
request.abort(); | ||
onCancelerSuccess(); | ||
}; | ||
}; | ||
} |
Oops, something went wrong.