Skip to content

Commit

Permalink
First set of tests added for the convertImage and convertPlainText fu…
Browse files Browse the repository at this point in the history
…nctions
  • Loading branch information
jdalrymple committed Feb 8, 2024
1 parent d58ee54 commit 63ad1f9
Show file tree
Hide file tree
Showing 25 changed files with 1,775 additions and 2,099 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ rules:
no-console:
- error
- allow:
- debug
- debug

no-use-before-define:
- error
Expand Down
165 changes: 165 additions & 0 deletions UPDATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
# Upgrade to Version 1

- Updating all dependencies
- Updating README
- Adding Typesaftey
- Merging additional functionality as tests from @
- Switching from Swyac for CLI functionality

## Moving From SWYAC

Swyac hasnt been maintained in over four years. Since were doing a full update of this library, now would be the best time to update this dep or replace it. Since its been lacking updates, I've been looking at alternatives that priortize 1. Easy of refactor 2. Maintenance 3. Size. I focused on these items since the CLI isnt very complicated and thus doesnt require any fancy support. Also, since type saftey was added to this library, an additional item that should be supported is 4. typing, and finally planning for the future, 5. ESM readiness.

### Alternatives

#### Swyac (for reference)

- Website: https://sywac.io/
- GH: https://github.com/sywac/sywac
- NPM: https://www.npmjs.com/package/sywac
- Latest Version: 1.3.0
- Last Release: March 29 2020
- Install Size: 103kB
- Package Size: 103kB

#### @oclif

- Website: https://oclif.io
- GH: github.com/oclif/core
- NPM: https://www.npmjs.com/package/@oclif/core
- Latest Version: 3.18.2
- Last Release: Feb 1 2024
- Install Size: 7.82Mb
- Package Size: 406kB

**PROs:**

- very mature
- supports everything under the sun
- has support for ESM and Typescript

**CONs:**

- Significantly more complex than what I need
- Requires a large rewrite to handle the structure for commands (doesnt support Fluid syntax)

#### commander

- GH: https://github.com/tj/commander.js
- NPM: https://www.npmjs.com/package/commander
- Latest Version: 12.0.0
- Last Release: Feb 3 2024
- Install Size: 177kB
- Package Size: 177kB

**PROs:**

- very mature
- well maintained

**CONs:**

#### @molt/command

- GH: https://github.com/jasonkuhrt/molt
- NPM: https://www.npmjs.com/package/@molt/command
- Latest Version: 0.9.0
- Last Release: Sept 23 2023
- Install Size: 3.38Mb (Looks like src files are also included which would add to this size)
- Package Size: 1.11Mb

**PROs:**

- very good type safety
- beautiful cli output
- supports ESM and Typescript
- support Fluid syntax

**CONs:**

- very new
- hasnt been worked on for over 6 months
- Quite extensive support for funcitonality that isnt needed here

#### cac

- GH: hhttps://github.com/cacjs/cac
- NPM: https://github.com/cacjs/cac?tab=readme-ov-file
- Latest Version: 6.7.14
- Last Release: Aug 28 2022
- Install Size: 79.9Kb
- Package Size: 79.9kB

**PROs:**

- Mature
- supports ESM and Typescript
- support Fluid syntax
- Simple API

**CONs:**

- Hasnt been touched in 2 years
- Requires embedding types into a string format

#### breadc => similar to cac

- Website: https://breadc.onekuma.cn/
- GH: https://github.com/yjl9903/Breadc
- Latest Version: 0.9.7
- Last Release: Oct 18 2023
- Install Size: 106kB
- Package Size: 84.0kB

**PROs:**

- supports ESM and Typescript
- support Fluid syntax
- Simple API

**CONs:**

- Pretty new
- Hasnt been touched in 5 months
- Requires embedding types into a string format

#### carporal

- Website: https://caporal.io/
- GH: https://github.com/mattallty/Caporal.js
- Latest Version: 3.0.0
- Last Release: Aug 23 2023
- Install Size: 14.9MB
- Package Size: 97.0kB

**PROs:**

- supports ESM and Typescript
- support Fluid syntax
- Simple API
- Supports validation

**CONs:**

- Hasnt been touched in 6 months

#### bandersnatch

- GH: https://github.com/hongaar/bandersnatch
- NPM: https://www.npmjs.com/package/bandersnatch
- Latest Version: 1.12.13
- Last Release: Nov 27 2023
- Install Size: 5.38MB
- Package Size: 119kB

**PROs:**

- Validation
- Simple API
- supports ESM and Typescript
- support Fluid syntax

**CONs:**

**Notes:**
Looks to be build off yargs
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,18 @@
"lint": "eslint 'src/**/*.{*(c|m)js,*(c|m)ts}'",
"lint:fix": "pnpm lint --fix",
"release": "auto shipit",
"test": "vitest test",
"test:unit": "vitest run --coverage",
"test:types": "tsc"
},
"resolutions": {
"all-contributors-cli": "6.26.1"
},
"dependencies": {
"@commander-js/extra-typings": "^12.0.0",
"commander": "^12.0.0",
"entities": "^4.5.0",
"nanoid": "^5.0.5",
"parse5": "^7.1.2",
"sywac": "^1.3.0",
"upath": "^2.0.1"
},
"devDependencies": {
Expand All @@ -66,21 +67,21 @@
"@auto-it/omit-commits": "^11.0.4",
"@auto-it/omit-release-notes": "^11.0.4",
"@auto-it/released": "^11.0.4",
"@types/node": "^20.11.16",
"@typescript-eslint/eslint-plugin": "^6.20.0",
"@typescript-eslint/parser": "^6.20.0",
"@types/node": "^20.11.16",
"@vitest/coverage-istanbul": "^1.2.2",
"auto": "^11.0.4",
"eslint": "^8.56.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^27.6.3",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"prettier": "^3.2.4",
"tempy": "^3.1.0",
"tsup": "^8.0.1",
"typescript": "^5.3.3"
"typescript": "^5.3.3",
"vitest": "^1.2.2"
}
}
Loading

0 comments on commit 63ad1f9

Please sign in to comment.