Skip to content
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

Release queue: major #3196

Open
wants to merge 6 commits into
base: next-minor
Choose a base branch
from
Open
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
5 changes: 5 additions & 0 deletions .changeset/brown-peas-compare.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"effect": major
---

make Logger.prettyLogger the default logger
24 changes: 24 additions & 0 deletions .changeset/chilled-ducks-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
"effect": major
---

Use object options for Stream.async apis

Instead of:

```ts
Stream.async((emit) => {
//...
}, 16);
```

You can now write:

```ts
Stream.async(
(emit) => {
//...
},
{ bufferSize: 16 },
);
```
5 changes: 5 additions & 0 deletions .changeset/cold-cougars-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"effect": minor
---

add TSubscriptionRef
6 changes: 6 additions & 0 deletions .changeset/happy-jeans-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"effect": major
---

For `Data.TaggedEnum` added capitalized constructor naming convention.
Helper functions `$is` and `$match` have been renamed to `is` and `match`.
5 changes: 5 additions & 0 deletions .changeset/poor-tools-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"effect": minor
---

add Logger.string Layer, for setting the logger to Logger.stringLogger
5 changes: 5 additions & 0 deletions .changeset/shiny-squids-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"effect": minor
---

add Stream.fromTQueue & Stream.fromTPubSub
5 changes: 5 additions & 0 deletions .changeset/tough-lobsters-guess.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"effect": minor
---

add option to .releaseLock a ReadableStream on finalization
7 changes: 7 additions & 0 deletions .changeset/young-knives-poke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"effect": major
"@effect/platform-node-shared": minor
"@effect/cli": minor
---

depreciate Secret module in favour of the Redacted module
11 changes: 0 additions & 11 deletions packages/cli/src/Args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import type { Effect } from "effect/Effect"
import type { Option } from "effect/Option"
import type { Pipeable } from "effect/Pipeable"
import type { Redacted } from "effect/Redacted"
import type { Secret } from "effect/Secret"
import type { CliConfig } from "./CliConfig.js"
import type { HelpDoc } from "./HelpDoc.js"
import * as InternalArgs from "./internal/args.js"
Expand Down Expand Up @@ -387,16 +386,6 @@ export const repeated: <A>(self: Args<A>) => Args<Array<A>> = InternalArgs.repea
*/
export const redacted: (config?: Args.BaseArgsConfig) => Args<Redacted> = InternalArgs.redacted

/**
* Creates a text argument.
*
* Can optionally provide a custom argument name (defaults to `"secret"`).
*
* @since 1.0.0
* @category constructors
*/
export const secret: (config?: Args.BaseArgsConfig) => Args<Secret> = InternalArgs.secret

/**
* Creates a text argument.
*
Expand Down
8 changes: 0 additions & 8 deletions packages/cli/src/Options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import type { HashMap } from "effect/HashMap"
import type { Option } from "effect/Option"
import type { Pipeable } from "effect/Pipeable"
import type { Redacted } from "effect/Redacted"
import type { Secret } from "effect/Secret"
import type { CliConfig } from "./CliConfig.js"
import type { HelpDoc } from "./HelpDoc.js"
import * as InternalOptions from "./internal/options.js"
Expand Down Expand Up @@ -315,13 +314,6 @@ export const none: Options<void> = InternalOptions.none
*/
export const redacted: (name: string) => Options<Redacted> = InternalOptions.redacted

/**
* @since 1.0.0
* @category constructors
* @deprecated
*/
export const secret: (name: string) => Options<Secret> = InternalOptions.secret

/**
* @since 1.0.0
* @category constructors
Expand Down
6 changes: 0 additions & 6 deletions packages/cli/src/internal/args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import * as Option from "effect/Option"
import { pipeArguments } from "effect/Pipeable"
import type * as Redacted from "effect/Redacted"
import * as Ref from "effect/Ref"
import type * as Secret from "effect/Secret"
import type * as Args from "../Args.js"
import type * as CliConfig from "../CliConfig.js"
import type * as HelpDoc from "../HelpDoc.js"
Expand Down Expand Up @@ -272,11 +271,6 @@ export const redacted = (
config?: Args.Args.BaseArgsConfig
): Args.Args<Redacted.Redacted> => makeSingle(Option.fromNullable(config?.name), InternalPrimitive.redacted)

/** @internal */
export const secret = (
config?: Args.Args.BaseArgsConfig
): Args.Args<Secret.Secret> => makeSingle(Option.fromNullable(config?.name), InternalPrimitive.secret)

/** @internal */
export const text = (config?: Args.Args.BaseArgsConfig): Args.Args<string> =>
makeSingle(Option.fromNullable(config?.name), InternalPrimitive.text)
Expand Down
5 changes: 0 additions & 5 deletions packages/cli/src/internal/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { pipeArguments } from "effect/Pipeable"
import * as Predicate from "effect/Predicate"
import type * as Redacted from "effect/Redacted"
import * as Ref from "effect/Ref"
import type * as Secret from "effect/Secret"
import type * as CliConfig from "../CliConfig.js"
import type * as HelpDoc from "../HelpDoc.js"
import type * as Options from "../Options.js"
Expand Down Expand Up @@ -386,10 +385,6 @@ export const none: Options.Options<void> = (() => {
export const redacted = (name: string): Options.Options<Redacted.Redacted> =>
makeSingle(name, Arr.empty(), InternalPrimitive.redacted)

/** @internal */
export const secret = (name: string): Options.Options<Secret.Secret> =>
makeSingle(name, Arr.empty(), InternalPrimitive.secret)

/** @internal */
export const text = (name: string): Options.Options<string> => makeSingle(name, Arr.empty(), InternalPrimitive.text)

Expand Down
35 changes: 0 additions & 35 deletions packages/cli/src/internal/primitive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { dual, pipe } from "effect/Function"
import * as Option from "effect/Option"
import { pipeArguments } from "effect/Pipeable"
import * as EffectRedacted from "effect/Redacted"
import * as EffectSecret from "effect/Secret"
import type * as CliConfig from "../CliConfig.js"
import type * as HelpDoc from "../HelpDoc.js"
import type * as Span from "../HelpDoc/Span.js"
Expand Down Expand Up @@ -52,7 +51,6 @@ export type Instruction =
| Float
| Integer
| Path
| Secret
| Redacted
| Text

Expand Down Expand Up @@ -90,9 +88,6 @@ export interface Path extends
/** @internal */
export interface Redacted extends Op<"Redacted", {}> {}

/** @internal */
export interface Secret extends Op<"Secret", {}> {}

/** @internal */
export interface Text extends Op<"Text", {}> {}

Expand Down Expand Up @@ -125,9 +120,6 @@ export const isIntegerType = (self: Instruction): self is Integer => self._tag =
/** @internal */
export const isPathType = (self: Instruction): self is Path => self._tag === "Path"

/** @internal */
export const isSecretType = (self: Instruction): self is Path => self._tag === "Path"

/** @internal */
export const isTextType = (self: Instruction): self is Text => self._tag === "Text"

Expand Down Expand Up @@ -205,13 +197,6 @@ export const redacted: Primitive.Primitive<EffectRedacted.Redacted> = (() => {
return op
})()

/** @internal */
export const secret: Primitive.Primitive<EffectSecret.Secret> = (() => {
const op = Object.create(proto)
op._tag = "Secret"
return op
})()

/** @internal */
export const text: Primitive.Primitive<string> = (() => {
const op = Object.create(proto)
Expand Down Expand Up @@ -283,7 +268,6 @@ const getChoicesInternal = (self: Instruction): Option.Option<string> => {
case "Integer":
case "Path":
case "Redacted":
case "Secret":
case "Text": {
return Option.none()
}
Expand Down Expand Up @@ -346,7 +330,6 @@ const getHelpInternal = (self: Instruction): Span.Span => {
`('${self.pathType}') and path existence ('${self.pathExists}')`
)
}
case "Secret":
case "Redacted": {
return InternalSpan.text("A user-defined piece of text that is confidential.")
}
Expand Down Expand Up @@ -382,9 +365,6 @@ const getTypeNameInternal = (self: Instruction): string => {
case "Redacted": {
return "redacted"
}
case "Secret": {
return "secret"
}
case "Text": {
return "text"
}
Expand Down Expand Up @@ -467,11 +447,6 @@ const validateInternal = (
Effect.map((value) => EffectRedacted.make(value))
)
}
case "Secret": {
return attempt(value, getTypeNameInternal(self), Schema.decodeUnknown(Schema.String)).pipe(
Effect.map((value) => EffectSecret.fromString(value))
)
}
case "Text": {
return attempt(value, getTypeNameInternal(self), Schema.decodeUnknown(Schema.String))
}
Expand Down Expand Up @@ -601,13 +576,6 @@ const wizardInternal = (self: Instruction, help: HelpDoc.HelpDoc): Prompt.Prompt
message: InternalHelpDoc.toAnsiText(message).trimEnd()
})
}
case "Secret": {
const primitiveHelp = InternalHelpDoc.p("Enter some text (value will be redacted)")
const message = InternalHelpDoc.sequence(help, primitiveHelp)
return InternalTextPrompt.hidden({
message: InternalHelpDoc.toAnsiText(message).trimEnd()
})
}
case "Text": {
const primitiveHelp = InternalHelpDoc.p("Enter some text")
const message = InternalHelpDoc.sequence(help, primitiveHelp)
Expand All @@ -631,7 +599,6 @@ export const getBashCompletions = (self: Instruction): string => {
case "DateTime":
case "Float":
case "Integer":
case "Secret":
case "Redacted":
case "Text": {
return "$(compgen -f \"${cur}\")"
Expand Down Expand Up @@ -675,7 +642,6 @@ export const getFishCompletions = (self: Instruction): Array<string> => {
case "Float":
case "Integer":
case "Redacted":
case "Secret":
case "Text": {
return Arr.make("-r", "-f")
}
Expand Down Expand Up @@ -755,7 +721,6 @@ export const getZshCompletions = (self: Instruction): string => {
}
}
case "Redacted":
case "Secret":
case "Text": {
return ""
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/internal/prompt/confirm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function renderSubmission(value: boolean, options: Options) {

function handleRender(options: Options) {
return (_: State, action: Prompt.Prompt.Action<State, boolean>) => {
return Action.$match(action, {
return Action.match(action, {
Beep: () => Effect.succeed(renderBeep),
NextFrame: ({ state }) => renderNextFrame(state, options),
Submit: ({ value }) => renderSubmission(value, options)
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/internal/prompt/date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ const defaultLocales: Prompt.Prompt.DateOptions["locales"] = {

function handleRender(options: DateOptions) {
return (state: State, action: Prompt.Prompt.Action<State, globalThis.Date>) => {
return Action.$match(action, {
return Action.match(action, {
Beep: () => Effect.succeed(renderBeep),
NextFrame: ({ state }) => renderNextFrame(state, options),
Submit: () => renderSubmission(state, options)
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/internal/prompt/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ type Confirm = Data.TaggedEnum<{
}>
const Confirm = Data.taggedEnum<Confirm>()

const showConfirmation = Confirm.$is("Show")
const showConfirmation = Confirm.is("Show")

const renderBeep = Doc.render(Doc.beep, { style: "pretty" })

Expand Down Expand Up @@ -235,7 +235,7 @@ function renderSubmission(value: string, options: FileOptions) {

function handleRender(options: FileOptions) {
return (_: State, action: Prompt.Prompt.Action<State, string>) => {
return Action.$match(action, {
return Action.match(action, {
Beep: () => Effect.succeed(renderBeep),
NextFrame: ({ state }) => renderNextFrame(state, options),
Submit: ({ value }) => renderSubmission(value, options)
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/internal/prompt/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ const initialState: State = {

function handleRenderInteger(options: IntegerOptions) {
return (state: State, action: Prompt.Prompt.Action<State, Number>) => {
return Action.$match(action, {
return Action.match(action, {
Beep: () => Effect.succeed(renderBeep),
NextFrame: ({ state }) => renderNextFrame(state, options),
Submit: () => renderSubmission(state, options)
Expand Down Expand Up @@ -298,7 +298,7 @@ export const integer = (options: Prompt.Prompt.IntegerOptions): Prompt.Prompt<nu

function handleRenderFloat(options: FloatOptions) {
return (state: State, action: Prompt.Prompt.Action<State, number>) => {
return Action.$match(action, {
return Action.match(action, {
Beep: () => Effect.succeed(renderBeep),
NextFrame: ({ state }) => renderNextFrame(state, options),
Submit: () => renderSubmission(state, options)
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/internal/prompt/select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function processNext<A>(state: State, choices: Prompt.Prompt.SelectOptions<A>["c

function handleRender<A>(options: SelectOptions<A>) {
return (state: State, action: Prompt.Prompt.Action<State, A>) => {
return Action.$match(action, {
return Action.match(action, {
Beep: () => Effect.succeed(renderBeep),
NextFrame: ({ state }) => renderNextFrame(state, options),
Submit: () => renderSubmission(state, options)
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/internal/prompt/text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ const initialState: State = {

function handleRender(options: Options) {
return (state: State, action: Prompt.Prompt.Action<State, string>) => {
return Action.$match(action, {
return Action.match(action, {
Beep: () => Effect.succeed(renderBeep),
NextFrame: ({ state }) => renderNextFrame(state, options),
Submit: () => renderSubmission(state, options)
Expand Down
10 changes: 0 additions & 10 deletions packages/effect/src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import type * as LogLevel from "./LogLevel.js"
import type * as Option from "./Option.js"
import type { Predicate, Refinement } from "./Predicate.js"
import type * as Redacted from "./Redacted.js"
import type * as Secret from "./Secret.js"
import type * as Types from "./Types.js"

/**
Expand Down Expand Up @@ -334,15 +333,6 @@ export const primitive: <A>(
*/
export const repeat: <A>(self: Config<A>) => Config<Array<A>> = internal.repeat

/**
* Constructs a config for a secret value.
*
* @since 2.0.0
* @category constructors
* @deprecated
*/
export const secret: (name?: string) => Config<Secret.Secret> = internal.secret

/**
* Constructs a config for a redacted value.
*
Expand Down
Loading