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

feat: add specs #35

Merged
merged 26 commits into from
Nov 11, 2024
Merged
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
1 change: 1 addition & 0 deletions .ecrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"exclude": [
"config.yml",
"CHANGELOG.md",
"pnpm-lock.yaml",
"README.md"
Expand Down
10 changes: 10 additions & 0 deletions .github/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
newIssueWelcomeComment: >
Thanks for opening your first **Issue** here!
Be sure to follow the **Issue template**!

newPRWelcomeComment: >
Thanks for opening this **Pull Request**!
Please check out our [Contributing Guidelines](https://github.com/archoleat/.github/blob/main/CONTRIBUTING.md).

firstPRMergeComment: >
Congrats on merging your first **Pull Request**!
49 changes: 0 additions & 49 deletions .github/workflows/codeql.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

jobs:
pre-commit:
name: Pre-commit
name: Pre Commit

if: ${{ github.actor != 'dependabot[bot]' }}

Expand All @@ -20,6 +20,8 @@ jobs:

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.13

- name: Lint
uses: pre-commit/action@v3.0.1
6 changes: 3 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ jobs:
run: pnpm i

- name: Build
run: pnpm build
run: pnpm rollup -c rollup.config.ts --configPlugin typescript

- name: Sanitize
run: rm -rf 'dist/{features,shared} app.d.ts'
run: rm -rf 'dist/{config,utils,data}'

- name: Pretty
- name: Prettify
run: pnpm prettier 'dist/index.d.ts' --write

- name: Create Release
Expand Down
21 changes: 7 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
![NPM Downloads](https://img.shields.io/npm/dm/%40archoleat%2Fnotifier)
![ESM](https://img.shields.io/badge/ESM-fe0)
![Provenance](https://img.shields.io/badge/Provenance-fo0)
![CodeQL](https://img.shields.io/github/actions/workflow/status/archoleat/notifier/codeql.yaml?label=CodeQL)
![Specs](https://img.shields.io/github/actions/workflow/status/archoleat/notifier/spec.yaml?label=Specs)
![Commitlint](https://img.shields.io/github/actions/workflow/status/archoleat/notifier/commitlint.yaml?label=Commitlint)
![Editorconfig](https://img.shields.io/github/actions/workflow/status/archoleat/notifier/editorconfig.yaml?label=Editorconfig)
Expand All @@ -19,8 +18,6 @@
- [Contributing](#contributing)
- [License](#license)

A small, simple and customizable notifier for your projects.

## Installation

```shell
Expand All @@ -33,17 +30,13 @@ bun i -D @archoleat/notifier
import { error, info, success, warning } from '@archoleat/notifier';

await info({
message:
[
'',
{
length: Infinity // Truncates the message after a specified number of characters.
},
]
| ['']
| '',
hasTime: true, // Enable/disable time, not work in desktop mode.
notificationMode: 'console', // Available modes: console, desktop, multiple.
message: 'string' | ['string', { maxLength: number }],
// Enable/disable timestamp, not work in desktop mode.
// @default true.
hasTime: boolean,
// Available modes: console, desktop, multiple.
// @default 'console'.
notificationMode: 'console' | 'desktop' | 'multiple',
});
```

Expand Down
26 changes: 12 additions & 14 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,23 @@
import { defineFlatConfig } from 'eslint-define-config';
import { extend } from '@archoleat/eslint-flat-compatibility';

import globals from 'globals';

import importSortPlugin from 'eslint-plugin-simple-import-sort';
import parser from '@typescript-eslint/parser';
import prettierConfig from 'eslint-config-prettier';
import unicornPlugin from 'eslint-plugin-unicorn';

import parser from '@typescript-eslint/parser';

export default defineFlatConfig([
...extend(
'airbnb-base',
'airbnb-typescript/base',
'plugin:import/recommended',
'plugin:import/typescript',
),
unicornPlugin.configs['flat/recommended'],
...extend('airbnb-base', 'airbnb-typescript/base'),
{
files: ['src/**/*.ts'],
languageOptions: {
parser,
ecmaVersion: 'latest',
globals: {
...globals.node,
...globals.es2015,
},
parserOptions: {
ecmaVersion: 'latest',
project: 'tsconfig.json',
},
sourceType: 'module',
Expand All @@ -36,13 +29,18 @@ export default defineFlatConfig([
},
},
},
plugins: {
'simple-import-sort': importSortPlugin,
unicorn: unicornPlugin,
},
rules: {
'no-console': 'off',
'simple-import-sort/imports': 'error',
'simple-import-sort/exports': 'error',
'import/exports-last': 'error',
'import/extensions': ['error', { ts: 'always' }],
'import/group-exports': 'error',
'import/no-commonjs': 'error',
'import/no-default-export': 'error',
'import/no-default-export': 'off',
'import/no-namespace': 'error',
'import/no-unassigned-import': 'error',
'import/prefer-default-export': 'off',
Expand Down
63 changes: 33 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@archoleat/notifier",
"description": "Simple notifier for plugins or bundlers",
"description": "A small, simple and customizable notifier for your projects",
"version": "1.0.3",
"license": "MIT",
"author": {
Expand Down Expand Up @@ -33,68 +33,71 @@
"type": "module",
"types": "dist/index.d.ts",
"imports": {
"#constants/*": "./src/shared/constants/*",
"#generators/*": "./src/shared/generators/*",
"#helpers/*": "./src/shared/helpers/*",
"#shared/*": "./src/shared/*",
"#types/*": "./src/shared/types/*"
"#config": "./src/config/index.ts",
"#utils": "./src/utils/index.ts",
"#generators": "./src/utils/generators/index.ts",
"#helpers": "./src/utils/helpers/index.ts",
"#index": "./src/index.ts",
"#data": "./src/data/index.ts"
},
"exports": {
".": "./dist/index.js"
},
"files": [
"dist"
"dist/icons",
"dist/index.d.ts",
"dist/index.js"
],
"scripts": {
"init": "pnpm i && husky",
"build": "rollup -c rollup.config.ts --configPlugin typescript"
"init": "pnpm i && husky"
},
"dependencies": {
"chalk": "^5.3.0",
"node-notifier": "^10.0.1"
},
"devDependencies": {
"@archoleat/commitlint-define-config": "^1.0.11",
"@archoleat/eslint-flat-compatibility": "^1.1.8",
"@archoleat/prettier-define-config": "^1.0.2",
"@archoleat/semantic-release-define-config": "^1.1.16",
"@commitlint/cli": "^19.4.1",
"@commitlint/config-conventional": "^19.4.1",
"@commitlint/types": "^19.0.3",
"@rollup/plugin-alias": "^5.1.0",
"@rollup/plugin-typescript": "^11.1.6",
"@archoleat/commitlint-define-config": "^1.1.0",
"@archoleat/eslint-flat-compatibility": "^1.2.1",
"@archoleat/prettier-define-config": "^1.1.0",
"@archoleat/semantic-release-define-config": "^1.2.0",
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@commitlint/types": "^19.5.0",
"@rollup/plugin-alias": "^5.1.1",
"@rollup/plugin-typescript": "^12.1.1",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"@types/node": "^22.5.2",
"@types/node": "^22.8.6",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@vitest/coverage-v8": "^2.0.5",
"@vitest/coverage-v8": "^2.1.4",
"conventional-changelog-conventionalcommits": "^8.0.0",
"editorconfig-checker": "^5.1.8",
"eslint": "^8.57.0",
"editorconfig-checker": "^6.0.0",
"eslint": "^8.57.1",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-define-config": "^2.1.0",
"eslint-import-resolver-typescript": "^3.6.3",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-unicorn": "^55.0.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-simple-import-sort": "^12.1.1",
"eslint-plugin-unicorn": "^56.0.0",
"git-pull-run": "^1.4.0",
"globals": "^15.9.0",
"husky": "^9.1.5",
"globals": "^15.11.0",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"remark": "15.0.1",
"remark-cli": "^12.0.1",
"remark-preset-lint-consistent": "^6.0.0",
"remark-preset-lint-markdown-style-guide": "^6.0.0",
"remark-preset-lint-recommended": "^7.0.0",
"rollup": "^4.21.2",
"rollup": "^4.24.3",
"rollup-plugin-copy": "^3.5.0",
"rollup-plugin-dts": "^6.1.1",
"rollup-plugin-esbuild": "^6.1.1",
"semantic-release": "^24.1.0",
"typescript": "^5.5.4",
"vitest": "^2.0.5"
"semantic-release": "^24.2.0",
"typescript": "^5.6.3",
"vitest": "^2.1.4"
}
}
Loading
Loading