Skip to content
Draft

Next #21

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: 3 additions & 2 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Setup
description:

inputs:
npm-token:
Expand All @@ -25,5 +26,5 @@ runs:
- name: Configure Git
shell: bash
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config user.name "${{ github.actor }}"
git config user.email "${{ github.actor }}@users.noreply.github.com"
21 changes: 21 additions & 0 deletions .github/badges/health.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 40 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
push:
branches: main

env:
BRANCH: ${{ github.head_ref || github.ref_name }}

jobs:
test:
name: Test
Expand All @@ -18,11 +21,46 @@ jobs:
uses: ./.github/actions/setup

- name: Test
run: npm test
run: npm run test:coverage

- name: Typecheck
run: npm run typecheck

generate:
name: Generate
runs-on: ubuntu-latest
timeout-minutes: 5
if: github.event_name == 'push'
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH }}

- name: Setup
uses: ./.github/actions/setup

- name: Generate Fallow Badge
run: npm run gen:fallow-badge

- name: Check for Changes
id: check_changes
run: |
if [[ -n "$(git diff --exit-code)" ]]; then
echo "Changes detected."
echo "has_changes=true" >> $GITHUB_OUTPUT
else
echo "No changes detected."
echo "has_changes=false" >> $GITHUB_OUTPUT
fi

- name: Commit
if: steps.check_changes.outputs.has_changes == 'true'
run: |
git add -A
git commit -m "chore: update generated files [skip ci]"
git push origin HEAD:${{ env.BRANCH }} --no-verify

code-style:
name: Code Style
runs-on: ubuntu-latest
Expand All @@ -35,7 +73,7 @@ jobs:
uses: ./.github/actions/setup

- name: Format
run: npm run format
run: npm run format:check

- name: Lint
run: npm run lint
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22
24
19 changes: 19 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"singleQuote": true,
"useTabs": true,
"tabWidth": 2,
"sortImports": true,
"options": {
"typeAware": true
},
"overrides": [
{
"files": ["*.yml"],
"options": {
"tabWidth": 2,
"useTabs": false
}
}
]
}
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"fallow-rs.fallow-vscode",
"oxc.oxc-vscode",
"streetsidesoftware.code-spell-checker"
]
}
13 changes: 8 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
"cSpell.words": [
"jinju",
"niobe",
"npmjs",
"nvmrc",
"oxfmt",
"oxlint",
"premajor",
"preminor",
"prepatch",
Expand All @@ -10,10 +14,9 @@
"yoctocolors"
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
"source.fixAll.oxc": "always"
},
"javascript.preferences.importModuleSpecifierEnding": "js",
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.autoImportSpecifierExcludeRegexes": ["node:test"],
"typescript.preferences.importModuleSpecifierEnding": "js"
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true,
"js/ts.preferences.autoImportSpecifierExcludeRegexes": ["node:test"]
}
19 changes: 18 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,24 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Setup `fallow`
- Coverage check
- CI summary support
- Flag support for `boolean`, `custom`, `number`, `string`, and `url`

### Changed

- VSCode config updates
- Reset repository to initial setup
- Replaced `eslint` with `oxlint`
- Replaced `prettier` with `oxfmt`
- Updated `node` to `v24`
- Updated `vitest` to `v4`
- Updated `typescript` to `v6`
- Updated LICENSE date

## [0.0.1] - 2025-05-06

### Added
Expand All @@ -17,5 +35,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

[unreleased]: https://github.com/simmo/jinju/compare/0.0.1...HEAD
[@simmo]: https://github.com/simmo

[0.0.1]: https://github.com/simmo/jinju/compare/0.0.1-beta.16...0.0.1
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 Mike Simmonds
Copyright (c) 2026 Mike Simmonds

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
166 changes: 2 additions & 164 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,174 +7,12 @@

<small>Opinionated Node CLI Toolkit</small>

[![npm (latest)](https://img.shields.io/npm/v/jinju/latest?color=00b894&label=latest&style=flat)](https://www.npmjs.com/package/jinju) [![npm (beta)](https://img.shields.io/npm/v/jinju/beta?color=0984e3&label=beta&style=flat)](https://www.npmjs.com/package/jinju?activeTab=versions) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/simmo/jinju/ci.yml?style=flat)](https://github.com/simmo/jinju/actions/workflows/ci.yml)
[![npm (latest)](https://img.shields.io/npm/v/jinju/latest?color=00b894&label=latest&style=flat)](https://www.npmjs.com/package/jinju) [![npm (beta)](https://img.shields.io/npm/v/jinju/beta?color=0984e3&label=beta&style=flat)](https://www.npmjs.com/package/jinju?activeTab=versions) [![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/simmo/jinju/ci.yml?style=flat)](https://github.com/simmo/jinju/actions/workflows/ci.yml) ![Fallow health](.github/badges/health.svg)

---

## API

Jump to:

- [`celebrate`](#celebrate)
- [`debug`](#debug)
- [`fail`](#fail)
- [`spinner`](#spinner)
- [`success`](#success)
- [`warn`](#warn)

### Celebrate

```ts
celebrate(message: string, context?: string)
```

Renders a celebration `message`, with optional `context`. If `context` is provided it is rendered dimmer than the `message`.

> [!TIP]
> Much like [`success`](#success), it can be used as a different type of positive message, like completing the process.

#### Example

```ts
import { celebrate } from 'jinju';

celebrate('Complete!');

celebrate('Complete!', 'On server A');
```

### Debug

```ts
debug(message: string)
```

Renders a debug `message`.

> [!TIP]
> Provides additional information without distracting from the core message output.

#### Example

Debug is enabled by default.

```ts
import { debug } from 'jinju';

debug('Found record');
```

You can disable debug message by setting the `config`'s `debug` value to `false`. In the example below the debug message will not be output.

```ts
import { config, debug } from 'jinju';

config.debug = false;

debug('Found record');
```

### Fail

```ts
fail(message: string, context?: string)
```

Renders a failure `message`, with optional `context`. If `context` is provided it is rendered dimmer than the `message`.

> [!TIP]
> Can be used to indicate a failure or error.

#### Example

```ts
import { fail } from 'jinju';

fail('Could not read file');

fail('Could not read file', './config.json');
```

### Spinner

Returns a spinner instance.

> [!TIP]
> Showing feedback during asynchronous processes.

#### `spinner.start(message: string)`

Starts the spinner with the provided message.

#### `spinner.text`

Can be used to update the spinner's message.

#### `spinner.stop()`

Stops the spinner and removes it from the output.

> **Note**
> If you don't call `spinner.stop()`, the process will not end until explicitly exited.

#### Example

```ts
import { spinner } from 'jinju';

spinner.start('Running some process');

await someProcess();

spinner.text = 'Running another process';

await anotherProcess();

spinner.stop();
```

### Success

```ts
success(message: string, context?: string)
```

Renders a success `message`, with optional `context`. If `context` is provided it is rendered dimmer than the `message`.

> [!TIP]
> Can be used to indicate an action has resolved as expected.

#### Example

```ts
import { success } from 'jinju';

success('Connected to server');

success('Connected to server', 'https://a.server.com');
```

### Warn

```ts
warn(message: string, context?: string)
```

Renders a warning `message`, with optional `context`. If `context` is provided it is rendered dimmer than the `message`.

> [!TIP]
> Can be used to provide awareness to a non-ideal resolution.

#### Example

```ts
import { success } from 'jinju';

success('Connected to server');

success('Connected to server', 'https://a.server.com');
```

---

<small>© 2025 [Mike Simmonds](https://mike.id)</small>
<small>© 2026 [Mike Simmonds](https://mike.id)</small>
Loading
Loading