-
Notifications
You must be signed in to change notification settings - Fork 11
Update for PureScript 0.15 #96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
108bee6
Update for PureScript 0.15
thomashoneyman 199e7e7
Update script/GenerateDefaultOperatorsModule.purs
thomashoneyman 1cf24d1
Re-run generate operators
thomashoneyman 456f1ed
Update Main.purs
thomashoneyman edee35e
Add alternate local dev entrypoint
thomashoneyman 4d1eaf2
Add explicit version scripts
thomashoneyman 258623b
Shuffle scripts back around
thomashoneyman 4f171c6
Update package.json
thomashoneyman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,13 +1,13 @@ | ||
const process = require("process"); | ||
import process from "process"; | ||
|
||
exports.hrtime = function() { | ||
export function hrtime() { | ||
var t = process.hrtime() | ||
return { seconds: t[0], nanos: t[1] }; | ||
}; | ||
} | ||
|
||
exports.hrtimeDiff = function(old) { | ||
export function hrtimeDiff(old) { | ||
return function() { | ||
var t = process.hrtime([old.seconds, old.nanos]); | ||
return { seconds: t[0], nanos: t[1] }; | ||
}; | ||
}; | ||
} |
This file contains hidden or 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 +1 @@ | ||
exports.version = require("../../package.json").version; | ||
export const version = "v0.8.0"; |
This file contains hidden or 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 hidden or 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env -S node --experimental-json-modules | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
import path from "path"; | ||
import { main } from "../output/Main/index.js"; | ||
|
||
const __dirname = path.dirname(new URL(import.meta.url).pathname); | ||
process.env["TIDY_INSTALL_LOC"] = path.resolve(__dirname, ".."); | ||
|
||
main(); |
This file contains hidden or 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,8 +1,8 @@ | ||
#!/usr/bin/env node | ||
var path = require("path"); | ||
import path from "path"; | ||
import { main } from "../bundle/Main/index.js"; | ||
|
||
const __dirname = path.dirname(new URL(import.meta.url).pathname); | ||
process.env["TIDY_INSTALL_LOC"] = path.resolve(__dirname, ".."); | ||
try { | ||
require("../bundle/Main/index.js"); | ||
} catch (e) { | ||
require("../output/Main/index.js").main(); | ||
} | ||
|
||
main(); |
This file contains hidden or 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 hidden or 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 hidden or 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,81 +1,39 @@ | ||
let upstream = | ||
https://github.com/purescript/package-sets/releases/download/psc-0.14.3-20210811/packages.dhall sha256:a2de7ef2f2e753733eddfa90573a82da0c7c61d46fa87d015b7f15ef8a6e97d5 | ||
https://github.com/purescript/package-sets/releases/download/psc-0.15.0-20220513/packages.dhall | ||
sha256:1ed784f37ae6131d99acd542d058d5ce39954ccaacc3adba5cc7cf1549d2bffa | ||
|
||
let overrides = {=} | ||
in upstream | ||
with node-glob-basic = | ||
{ dependencies = | ||
[ "aff" | ||
, "console" | ||
, "effect" | ||
, "lists" | ||
, "maybe" | ||
, "node-fs-aff" | ||
, "node-path" | ||
, "node-process" | ||
, "ordered-collections" | ||
, "strings" | ||
] | ||
, repo = "https://github.com/natefaubion/purescript-node-glob-basic.git" | ||
, version = "v1.2.2" | ||
} | ||
|
||
let additions = | ||
{ purescript-language-cst-parser = | ||
{ dependencies = | ||
[ "arrays" | ||
, "const" | ||
, "effect" | ||
, "either" | ||
, "foldable-traversable" | ||
, "free" | ||
, "functors" | ||
, "maybe" | ||
, "numbers" | ||
, "ordered-collections" | ||
, "strings" | ||
, "transformers" | ||
, "tuples" | ||
, "typelevel-prelude" | ||
] | ||
, repo = | ||
"https://github.com/natefaubion/purescript-language-cst-parser.git" | ||
, version = "v0.11.0" | ||
} | ||
, dodo-printer = | ||
{ dependencies = | ||
[ "ansi", "foldable-traversable", "lists", "maybe", "strings" ] | ||
, repo = "https://github.com/natefaubion/purescript-dodo-printer.git" | ||
, version = "v2.1.0" | ||
} | ||
, node-glob-basic = | ||
{ dependencies = | ||
[ "aff" | ||
, "console" | ||
, "effect" | ||
, "lists" | ||
, "maybe" | ||
, "node-fs-aff" | ||
, "node-path" | ||
, "node-process" | ||
, "ordered-collections" | ||
, "strings" | ||
] | ||
, repo = "https://github.com/natefaubion/purescript-node-glob-basic.git" | ||
, version = "v1.2.2" | ||
} | ||
, node-workerbees = | ||
{ dependencies = | ||
[ "aff" | ||
, "argonaut-core" | ||
, "arraybuffer-types" | ||
, "avar" | ||
, "effect" | ||
, "either" | ||
, "exceptions" | ||
, "maybe" | ||
, "newtype" | ||
, "parallel" | ||
, "variant" | ||
] | ||
, repo = "https://github.com/natefaubion/purescript-node-workerbees.git" | ||
, version = "v0.2.1" | ||
} | ||
, argparse-basic = | ||
{ dependencies = | ||
[ "either" | ||
, "foldable-traversable" | ||
, "lists" | ||
, "maybe" | ||
, "record" | ||
, "strings" | ||
] | ||
, repo = "https://github.com/natefaubion/purescript-argparse-basic.git" | ||
, version = "v1.0.0" | ||
} | ||
} | ||
|
||
in upstream // overrides // additions | ||
with node-workerbees = | ||
{ dependencies = | ||
[ "aff" | ||
, "argonaut-core" | ||
, "arraybuffer-types" | ||
, "avar" | ||
, "effect" | ||
, "either" | ||
, "exceptions" | ||
, "maybe" | ||
, "newtype" | ||
, "parallel" | ||
, "variant" | ||
] | ||
, repo = "https://github.com/natefaubion/purescript-node-workerbees.git" | ||
, version = "node-esm" | ||
} |
This file contains hidden or 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,6 +1,8 @@ | ||
const fs = require("fs"); | ||
const os = require("os"); | ||
const path = require("path"); | ||
import fs from "fs"; | ||
import os from "os"; | ||
import path from "path"; | ||
|
||
exports.tmpdir = (prefix) => () => | ||
fs.mkdtempSync(path.join(os.tmpdir(), prefix), "utf-8"); | ||
export function tmpdir(prefix) { | ||
return () => | ||
fs.mkdtempSync(path.join(os.tmpdir(), prefix), "utf-8"); | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exists
was removed as part of the 0.15 updates, as its been recommended against by Node for years. This instead tries to stat the file, and if that throws an exception (the file is missing) then we write the file.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't you use
liftEffect $ FSSync.exists
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is also possible, but we can use proper async here via stat (which is also used elsewhere in this file)