@savvy-web/github-action-effects 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/index.d.ts +2 -1
- package/index.js +2 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Composable [Effect](https://effect.website) services for building Node.js 24 Git
|
|
|
17
17
|
## Installation
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
npm install @savvy-web/github-action-effects effect @actions/core
|
|
20
|
+
npm install @savvy-web/github-action-effects effect @actions/core @effect/platform @effect/platform-node
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
## Quick Start
|
|
@@ -36,7 +36,7 @@ const program = Effect.gen(function* () {
|
|
|
36
36
|
Action.run(program);
|
|
37
37
|
```
|
|
38
38
|
|
|
39
|
-
`Action.run` provides all core service layers, installs the Effect logger, and catches errors with `core.setFailed` automatically.
|
|
39
|
+
`Action.run` provides all core service layers (including `NodeContext.layer` for `FileSystem`, `Path`, `Terminal`, `CommandExecutor`, and `WorkerManager` from `@effect/platform`), installs the Effect logger, and catches errors with `core.setFailed` automatically.
|
|
40
40
|
|
|
41
41
|
See the [full walkthrough](./docs/example-action.md) for log level configuration, batch input reading, GFM summaries, multi-phase state, and error handling.
|
|
42
42
|
|
package/index.d.ts
CHANGED
|
@@ -15,6 +15,7 @@ import { FiberRef } from 'effect';
|
|
|
15
15
|
import { Layer } from 'effect';
|
|
16
16
|
import { Logger } from 'effect/Logger';
|
|
17
17
|
import type { Option } from 'effect';
|
|
18
|
+
import * as PlatformNode from '@effect/platform-node';
|
|
18
19
|
import { Schema } from 'effect';
|
|
19
20
|
import { YieldableError } from 'effect/Cause';
|
|
20
21
|
|
|
@@ -471,7 +472,7 @@ export declare const ChecklistItem: Schema.Struct<{
|
|
|
471
472
|
export declare type ChecklistItem = typeof ChecklistItem.Type;
|
|
472
473
|
|
|
473
474
|
/** Core services provided automatically by {@link Action.run}. */
|
|
474
|
-
export declare type CoreServices = ActionInputs | ActionLogger | ActionOutputs;
|
|
475
|
+
export declare type CoreServices = ActionInputs | ActionLogger | ActionOutputs | PlatformNode.NodeContext.NodeContext;
|
|
475
476
|
|
|
476
477
|
/**
|
|
477
478
|
* FiberRef that holds the current action log level for the fiber.
|
package/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { addPath, debug, endGroup, error as core_error, exportVariable, getInput, getMultilineInput, getState, info, notice, saveState, setFailed, setOutput, setSecret, startGroup, summary as core_summary, warning } from "@actions/core";
|
|
2
|
+
import { NodeContext } from "@effect/platform-node";
|
|
2
3
|
import { Cause, Context, Data, Effect, FiberRef, FiberRefs, Layer, LogLevel, Logger, Option, Schema } from "effect";
|
|
3
4
|
const ActionInputErrorBase = Data.TaggedError("ActionInputError");
|
|
4
5
|
class ActionInputError extends ActionInputErrorBase {
|
|
@@ -161,7 +162,7 @@ const resolveLogLevel = (input)=>{
|
|
|
161
162
|
if ("auto" !== input) return input;
|
|
162
163
|
return "1" === process.env.RUNNER_DEBUG ? "debug" : "info";
|
|
163
164
|
};
|
|
164
|
-
const CoreLive = Layer.mergeAll(ActionInputsLive, ActionLoggerLive, ActionOutputsLive);
|
|
165
|
+
const CoreLive = Layer.mergeAll(ActionInputsLive, ActionLoggerLive, ActionOutputsLive, NodeContext.layer);
|
|
165
166
|
const Action = {
|
|
166
167
|
run: (program, layer)=>{
|
|
167
168
|
const fullLayer = layer ? Layer.mergeAll(CoreLive, layer) : CoreLive;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvy-web/github-action-effects",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Effect-based utility library for building robust, well-logged, and schema-validated GitHub Actions.",
|
|
6
6
|
"homepage": "https://github.com/savvy-web/github-action-effects#readme",
|
|
@@ -43,10 +43,10 @@
|
|
|
43
43
|
"optional": true
|
|
44
44
|
},
|
|
45
45
|
"@effect/platform": {
|
|
46
|
-
"optional":
|
|
46
|
+
"optional": false
|
|
47
47
|
},
|
|
48
48
|
"@effect/platform-node": {
|
|
49
|
-
"optional":
|
|
49
|
+
"optional": false
|
|
50
50
|
},
|
|
51
51
|
"effect": {
|
|
52
52
|
"optional": false
|