Skip to content

Exploration #629

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

Draft
wants to merge 54 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
42fa64b
test: add utils/extend
pigoz Jan 6, 2023
12b01ce
add effectify function
pigoz Jan 6, 2023
5f20b20
add failing test
pigoz Jan 6, 2023
dbbfc3b
chore: add fs, net and stream
Jan 22, 2023
39ee13d
chore: pnpm up
Jan 22, 2023
7b5d9a0
chore: add fs stream example
Jan 22, 2023
695b300
refactor: DEFAULT_CHUNK_SIZE
Jan 22, 2023
0a7a4c2
refactor: ignoreLogged for fs close
Jan 22, 2023
ba3301f
fix: emit initial readable
Jan 22, 2023
f160a14
Merge remote-tracking branch 'upstream/effectify' into explore
Jan 24, 2023
fa70aa5
feat: add mapSyncError to effectify
Jan 24, 2023
353bed6
refactor: use node: imports
Jan 24, 2023
9c0b221
refactor: wrap file descriptors
Jan 24, 2023
cb598a4
chore: update deps
tim-smart Feb 4, 2023
6f1810b
refactor: effectify
tim-smart Feb 4, 2023
0e84569
fix: fs
tim-smart Feb 4, 2023
19c4584
fix: stream
tim-smart Feb 4, 2023
40df19d
feat: simple runMain
tim-smart Feb 4, 2023
b5aa94f
chore: fix fs example
tim-smart Feb 4, 2023
7583cea
chore: fix formatting
tim-smart Feb 4, 2023
465bf46
chore: test deply to gist
tim-smart Feb 4, 2023
453d327
refactor: interruptAll
Feb 5, 2023
9f6a890
refactor: clean up runMain
tim-smart Feb 5, 2023
e2068ba
feat: expose modules
tim-smart Feb 5, 2023
e6d74d6
chore: update examples
tim-smart Feb 5, 2023
20abbff
feat: fs copyFile
tim-smart Feb 5, 2023
2bb1379
chore: add basic runtime test
tim-smart Feb 5, 2023
c72fa81
chore: silence docs errors for now
tim-smart Feb 5, 2023
92e1712
feat: mkdir and better errors
tim-smart Feb 5, 2023
a553a64
fix: writeFile return type
tim-smart Feb 5, 2023
130fdc8
fix: remove src/ from effect/io types
tim-smart Feb 5, 2023
09511dd
fix: export fs error types
tim-smart Feb 5, 2023
a3f43e7
fix: remove internal for now
tim-smart Feb 5, 2023
adc298d
chore: tsplus for runMain
Feb 5, 2023
8287f9e
chore: add tsplus config
tim-smart Feb 6, 2023
497c182
feat: add Fs rm
tim-smart Feb 6, 2023
9ba7a44
chore: update gist workflow
tim-smart Feb 7, 2023
de02e85
chore: revert tsplus changes
tim-smart Feb 7, 2023
d65e119
chore: pnpm up
tim-smart Feb 7, 2023
5528f0a
chore: fix fs example
tim-smart Feb 7, 2023
8627eca
refactor: improve effectify with infer
tim-smart Feb 8, 2023
4e48c78
refactor: improve `endOnExit` for Stream.sink
tim-smart Feb 8, 2023
afc5b3b
refactor: optional encoding for Stream.sink
tim-smart Feb 8, 2023
c99f0f1
fix: die if fs.close fails
Feb 8, 2023
f42860c
chore: pnpm up
tim-smart Feb 9, 2023
0f5bb5a
Merge branch 'explore' of https://github.com/tim-smart/node-1 into ex…
tim-smart Feb 9, 2023
7153d11
refactor: underscore unused infer's
tim-smart Feb 18, 2023
f2cf8f2
chore: update deps
tim-smart Feb 27, 2023
5f7ae48
chore: update deps
tim-smart Mar 5, 2023
45b7666
chore: update deps
tim-smart Mar 13, 2023
99805df
chore: update deps
tim-smart Mar 14, 2023
ca9a51e
chore: update deps
Mar 23, 2023
b73fe0c
chore: update deps
tim-smart Mar 30, 2023
a39b9f4
Merge branch 'explore' of https://github.com/tim-smart/node-1 into ex…
tim-smart Mar 30, 2023
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
46 changes: 46 additions & 0 deletions .github/workflows/gist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Deploy to gist

on:
workflow_dispatch: {}

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.17.1]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- uses: pnpm/[email protected]
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false
- name: Get pnpm store directory
id: pnpm-cache
run: |
echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: pnpm install
- run: pnpm run pack
- name: upload-to-gist
uses: tim-smart/actions-upload-to-gist@v3
with:
gist_token: ${{ secrets.GIST_TOKEN }}
gist_id: 2249154d563bbbdd603cb09e834361e8
path: build/artifacts
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
- run: pnpm run circular
- run: pnpm run test --coverage
- run: pnpm run lint
- run: pnpm run docs
# - run: pnpm run docs
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.ts
19 changes: 19 additions & 0 deletions examples/fs.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { pipe } from "@effect/data/Function"
import * as Effect from "@effect/io/Effect"
import { LiveNodeFs, NodeFs } from "@effect/node/Fs"
import { runMain } from "@effect/node/Runtime"
import * as Stream from "@effect/stream/Stream"

const program = Effect.gen(function*($) {
const fs = yield* $(NodeFs)

yield* $(
pipe(fs.stream(process.argv[2]), Stream.run(fs.sink(process.argv[3])))
)
})

pipe(
Effect.provideLayer(program, LiveNodeFs),
Effect.catchAllCause(Effect.logErrorCause),
runMain
)
6 changes: 6 additions & 0 deletions examples/runtime.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import * as Duration from "@effect/data/Duration"
import { pipe } from "@effect/data/Function"
import * as Effect from "@effect/io/Effect"
import * as RT from "@effect/node/Runtime"

pipe(Effect.fail("boom"), Effect.delay(Duration.minutes(1)), RT.runMain)
66 changes: 33 additions & 33 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"docs-update": "git add --force --all docs/modules || true",
"circular": "madge --ts-config ./tsconfig.madge.json --circular --no-color --no-spinner --warning build/esm",
"test": "vitest",
"coverage": "vitest run --coverage"
"coverage": "vitest run --coverage",
"pack": "pnpm build && cd dist && pnpm pack --pack-destination=../build/artifacts"
},
"exports": {
".": {
Expand All @@ -56,61 +57,60 @@
}
},
"dependencies": {
"@effect/io": "~0.0.52",
"@fp-ts/core": "~0.0.11",
"@fp-ts/data": "~0.0.36"
"@effect/data": "~0.7.4",
"@effect/io": "~0.15.1",
"@effect/stream": "~0.14.0"
},
"devDependencies": {
"@babel/cli": "^7.20.7",
"@babel/core": "^7.20.7",
"@babel/plugin-transform-modules-commonjs": "^7.20.11",
"@babel/cli": "^7.21.0",
"@babel/core": "^7.21.3",
"@babel/plugin-transform-modules-commonjs": "^7.21.2",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.0",
"@changesets/cli": "^2.26.1",
"@effect-ts/build-utils": "0.40.3",
"@effect-ts/core": "^0.60.2",
"@effect/language-service": "0.0.15",
"@effect/language-service": "0.0.19",
"@effect/vite-plugin": "^0.0.1",
"@repo-tooling/eslint-plugin-dprint": "^0.0.4",
"@rollup/pluginutils": "^5.0.2",
"@types/benchmark": "^2.1.2",
"@types/chai": "^4.3.4",
"@types/glob": "^8.0.0",
"@types/jest": "^29.2.5",
"@types/node": "^18.11.18",
"@types/glob": "^8.1.0",
"@types/jest": "^29.5.0",
"@types/node": "^18.15.11",
"@types/prettier": "2.7.2",
"@types/rimraf": "^3.0.2",
"@typescript-eslint/eslint-plugin": "^5.48.0",
"@typescript-eslint/parser": "^5.48.0",
"@vitest/coverage-c8": "^0.26.3",
"@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.57.0",
"@vitest/coverage-c8": "^0.29.8",
"babel-plugin-annotate-pure-calls": "^0.4.0",
"concurrently": "^7.6.0",
"concurrently": "^8.0.1",
"cpx": "^1.5.0",
"docs-ts": "0.6.10",
"eslint": "^8.31.0",
"eslint-import-resolver-typescript": "^3.5.2",
"docs-ts": "0.7.0",
"eslint": "^8.37.0",
"eslint-import-resolver-typescript": "^3.5.4",
"eslint-plugin-codegen": "0.17.0",
"eslint-plugin-deprecation": "^1.3.3",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-simple-import-sort": "^8.0.0",
"eslint-plugin-sort-destructure-keys": "^1.4.0",
"fast-check": "^3.5.0",
"glob": "^8.0.3",
"madge": "^5.0.1",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-simple-import-sort": "^10.0.0",
"eslint-plugin-sort-destructure-keys": "^1.5.0",
"fast-check": "^3.8.0",
"glob": "^9.3.2",
"madge": "^6.0.0",
"picocolors": "^1.0.0",
"prettier": "^2.8.1",
"rimraf": "^3.0.2",
"prettier": "^2.8.7",
"rimraf": "^4.4.1",
"ts-codemod": "^4.0.4",
"ts-node": "^10.9.1",
"tslint": "^6.1.3",
"typescript": "https://cdn.jsdelivr.net/npm/@tsplus/[email protected]/compiler/typescript.tgz",
"typescript": "5.0.2",
"ultra-runner": "^3.10.5",
"vite": "^4.0.4",
"vitest": "0.26.3"
"vite": "^4.2.1",
"vitest": "0.29.8",
"vitest-mock-process": "^1.0.4"
},
"pnpm": {
"patchedDependencies": {
"@effect-ts/[email protected]": "patches/@[email protected]",
"[email protected]": "patches/[email protected]"
"@effect-ts/[email protected]": "patches/@[email protected]"
}
},
"config": {
Expand Down
Loading