Skip to content

Prep repo #37

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 3 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: purescript-contrib/setup-purescript@main
with:
purescript: "unstable"
purs-tidy: "latest"

- uses: actions/setup-node@v2
- uses: actions/setup-node@v3
with:
node-version: "14"
node-version: "lts/*"

- name: Install dependencies
run: |
Expand All @@ -33,3 +34,8 @@ jobs:
run: |
bower install
npm run-script test --if-present

- name: Check Formatting
if: runner.os == 'Linux'
run: |
npx purs-tidy check src
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ New features:
Bugfixes:

Other improvements:
- Bumped CI's node version to `lts/*` (#37 by @JordanMartinez)
- Updated CI `actions/checkout` and `actions/setup-nodee` to `v3` (#37 by @JordanMartinez)
- Format codebase & enforce formatting in CI via purs-tidy (#37 by @JordanMartinez)

## [v10.0.0](https://github.com/purescript-node/purescript-node-process/releases/tag/v10.0.0) - 2022-04-29

Expand Down
32 changes: 16 additions & 16 deletions src/Node/Platform.purs
Original file line number Diff line number Diff line change
Expand Up @@ -18,36 +18,36 @@ data Platform

-- | The String representation for a platform, recognised by Node.js.
toString :: Platform -> String
toString AIX = "aix"
toString Darwin = "darwin"
toString AIX = "aix"
toString Darwin = "darwin"
toString FreeBSD = "freebsd"
toString Linux = "linux"
toString Linux = "linux"
toString OpenBSD = "openbsd"
toString SunOS = "sunos"
toString Win32 = "win32"
toString SunOS = "sunos"
toString Win32 = "win32"
toString Android = "android"

-- | Attempt to parse a `Platform` value from a string, in the format returned
-- | by Node.js' `process.platform`.
fromString :: String -> Maybe Platform
fromString "aix" = Just AIX
fromString "darwin" = Just Darwin
fromString "aix" = Just AIX
fromString "darwin" = Just Darwin
fromString "freebsd" = Just FreeBSD
fromString "linux" = Just Linux
fromString "linux" = Just Linux
fromString "openbsd" = Just OpenBSD
fromString "sunos" = Just SunOS
fromString "win32" = Just Win32
fromString "sunos" = Just SunOS
fromString "win32" = Just Win32
fromString "android" = Just Android
fromString _ = Nothing
fromString _ = Nothing

instance showPlatform :: Show Platform where
show AIX = "AIX"
show Darwin = "Darwin"
show AIX = "AIX"
show Darwin = "Darwin"
show FreeBSD = "FreeBSD"
show Linux = "Linux"
show Linux = "Linux"
show OpenBSD = "OpenBSD"
show SunOS = "SunOS"
show Win32 = "Win32"
show SunOS = "SunOS"
show Win32 = "Win32"
show Android = "Android"

derive instance eqPlatform :: Eq Platform
Expand Down