Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
refactor library internals to fix numerous issues
Browse files Browse the repository at this point in the history
  • Loading branch information
IMax153 committed Nov 9, 2023
1 parent cb397cf commit 03c585d
Show file tree
Hide file tree
Showing 47 changed files with 4,920 additions and 3,610 deletions.
5 changes: 5 additions & 0 deletions .changeset/shaggy-countries-kneel.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@effect/cli": minor
---

refactor library internals to fix a number of different bugs
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ dist/
/dist
/Args
/AutoCorrect
/BuiltInOption
/BuiltInOptions
/CliApp
/CliConfig
/Command
/CommandDirective
/Exists
/HelpDoc
/Options
/Parameter
/Primitive
/Prompt
/ShellType
Expand Down
3 changes: 2 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,15 @@
"dist": true,
"Args": true,
"AutoCorrect": true,
"BuiltInOption": true,
"BuiltInOptions": true,
"CliApp": true,
"CliConfig": true,
"Command": true,
"CommandDirective": true,
"Exists": true,
"HelpDoc": true,
"Options": true,
"Parameter": true,
"Primitive": true,
"Prompt": true,
"ShellType": true,
Expand Down
8 changes: 4 additions & 4 deletions .vscode/snippets.code-snippets
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
"Gen Function $": {
"prefix": "gg",
"body": [
"Effect.gen(function*($) {",
"Effect.gen(function*(_) {",
" $0",
"})"
],
"description": "Generator Function with a $ parameter"
"description": "Generator Function with a _ parameter"
},
"Gen Yield $": {
"prefix": "yy",
"body": [
"yield* $($0)"
"yield* _($0)"
],
"description": "Yield generator calling $()"
"description": "Yield generator calling _()"
}
}
10 changes: 5 additions & 5 deletions examples/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ export interface RemoveRemote extends Data.Case {
export const RemoveRemote = Data.tagged<RemoveRemote>("RemoveRemote")

const add: Command.Command<GitSubcommand> = pipe(
Command.make("add", { options: Options.boolean("m"), args: Args.text({ name: "directory" }) }),
Command.standard("add", { options: Options.boolean("m"), args: Args.text({ name: "directory" }) }),
Command.withHelp(HelpDoc.p("Description of the `git add` subcommand")),
Command.map(({ args: directory, options: modified }) => Add({ modified, directory }))
)

const addRemote: Command.Command<RemoteSubcommand> = pipe(
Command.make("add", {
Command.standard("add", {
options: Options.all({
name: Options.text("name"),
url: Options.text("url")
Expand All @@ -69,20 +69,20 @@ const addRemote: Command.Command<RemoteSubcommand> = pipe(
)

const removeRemote: Command.Command<RemoteSubcommand> = pipe(
Command.make("remove", { args: Args.text({ name: "name" }) }),
Command.standard("remove", { args: Args.text({ name: "name" }) }),
Command.withHelp(HelpDoc.p("Description of the `git remote remove` subcommand")),
Command.map(({ args: name }) => RemoveRemote({ name }))
)

const remote: Command.Command<GitSubcommand> = pipe(
Command.make("remote", { options: Options.alias(Options.boolean("verbose"), "v") }),
Command.standard("remote", { options: Options.boolean("verbose").pipe(Options.withAlias("v")) }),
Command.withHelp("Description of the `git remote` subcommand"),
Command.subcommands([addRemote, removeRemote]),
Command.map(({ options: verbose, subcommand }) => Remote({ verbose, subcommand }))
)

const git: Command.Command<Git> = pipe(
Command.make("git", { options: Options.alias(Options.boolean("version"), "v") }),
Command.standard("git", { options: Options.boolean("version").pipe(Options.withAlias("v")) }),
Command.subcommands([add, remote]),
Command.map(({ options: version, subcommand }) => Git({ version, subcommand }))
)
Expand Down
41 changes: 24 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,38 +57,38 @@
"effect": {
"generateIndex": true
},
"packageManager": "pnpm@8.9.0",
"packageManager": "pnpm@8.10.2",
"peerDependencies": {
"@effect/printer": "^0.22.1",
"@effect/printer-ansi": "^0.22.1",
"@effect/schema": "^0.47.1",
"@effect/printer": "^0.18.0",
"@effect/printer-ansi": "^0.18.0",
"@effect/schema": "^0.43.0",
"effect": "2.0.0-next.54"
},
"devDependencies": {
"@babel/core": "^7.23.2",
"@babel/preset-typescript": "^7.23.2",
"@changesets/changelog-github": "^0.4.8",
"@changesets/cli": "^2.26.2",
"@effect/build-utils": "^0.1.9",
"@effect/docgen": "^0.2.1",
"@effect/build-utils": "^0.3.0",
"@effect/docgen": "^0.3.0",
"@effect/eslint-plugin": "^0.1.2",
"@effect/language-service": "^0.0.21",
"@effect/printer": "^0.22.1",
"@effect/printer-ansi": "^0.22.1",
"@effect/schema": "^0.47.1",
"@effect/schema": "^0.47.2",
"@preconstruct/cli": "^2.8.1",
"@types/chai": "^4.3.9",
"@types/node": "^20.8.10",
"@typescript-eslint/eslint-plugin": "^6.9.1",
"@typescript-eslint/parser": "^6.9.1",
"@typescript-eslint/eslint-plugin": "^6.10.0",
"@typescript-eslint/parser": "^6.10.0",
"@vitejs/plugin-react": "^4.1.1",
"@vitest/coverage-v8": "^0.34.6",
"babel-plugin-annotate-pure-calls": "^0.4.0",
"effect": "2.0.0-next.54",
"error-stack-parser": "^2.1.4",
"eslint": "^8.52.0",
"eslint": "^8.53.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-codegen": "0.17.0",
"eslint-plugin-codegen": "0.18.1",
"eslint-plugin-deprecation": "^2.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-simple-import-sort": "^10.0.0",
Expand All @@ -106,14 +106,15 @@
"dist",
"Args",
"AutoCorrect",
"BuiltInOption",
"BuiltInOptions",
"CliApp",
"CliConfig",
"Command",
"CommandDirective",
"Exists",
"HelpDoc",
"Options",
"Parameter",
"Primitive",
"Prompt",
"ShellType",
Expand Down Expand Up @@ -141,11 +142,11 @@
"import": "./AutoCorrect/dist/effect-cli-AutoCorrect.cjs.mjs",
"default": "./AutoCorrect/dist/effect-cli-AutoCorrect.cjs.js"
},
"./BuiltInOption": {
"types": "./dist/declarations/src/BuiltInOption.d.ts",
"module": "./BuiltInOption/dist/effect-cli-BuiltInOption.esm.js",
"import": "./BuiltInOption/dist/effect-cli-BuiltInOption.cjs.mjs",
"default": "./BuiltInOption/dist/effect-cli-BuiltInOption.cjs.js"
"./BuiltInOptions": {
"types": "./dist/declarations/src/BuiltInOptions.d.ts",
"module": "./BuiltInOptions/dist/effect-cli-BuiltInOptions.esm.js",
"import": "./BuiltInOptions/dist/effect-cli-BuiltInOptions.cjs.mjs",
"default": "./BuiltInOptions/dist/effect-cli-BuiltInOptions.cjs.js"
},
"./CliApp": {
"types": "./dist/declarations/src/CliApp.d.ts",
Expand Down Expand Up @@ -195,6 +196,12 @@
"import": "./Options/dist/effect-cli-Options.cjs.mjs",
"default": "./Options/dist/effect-cli-Options.cjs.js"
},
"./Parameter": {
"types": "./dist/declarations/src/Parameter.d.ts",
"module": "./Parameter/dist/effect-cli-Parameter.esm.js",
"import": "./Parameter/dist/effect-cli-Parameter.cjs.mjs",
"default": "./Parameter/dist/effect-cli-Parameter.cjs.js"
},
"./Primitive": {
"types": "./dist/declarations/src/Primitive.d.ts",
"module": "./Primitive/dist/effect-cli-Primitive.esm.js",
Expand Down
Loading

0 comments on commit 03c585d

Please sign in to comment.