Skip to content

Commit

Permalink
refactor: fixes and chores
Browse files Browse the repository at this point in the history
  • Loading branch information
apteryxxyz committed Mar 1, 2024
1 parent dbbf4f0 commit 3adf5c6
Show file tree
Hide file tree
Showing 25 changed files with 2,818 additions and 5,562 deletions.
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

File renamed without changes.
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
# npm
node_modules/
.yarn/*
!.yarn/releases
!.yarn/plugins

# build
dist/
temp/
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["biomejs.biome"]
}
32 changes: 19 additions & 13 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
{
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/node_modules": true
},
"prettier.endOfLine": "lf",
"files.insertFinalNewline": true
}
{
"editor.formatOnSave": true,
"editor.insertSpaces": true,
"editor.tabSize": 2,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/Thumbs.db": true,
"**/node_modules": true
},
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "explicit"
},
"cSpell.language": "en-GB",
"cSpell.words": ["timeframe", "tsup"]
}
19 changes: 1 addition & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,12 @@

## Features

- Localisation support!
- Localisation support
- Convert from milliseconds to time-frame
- Convert from time-frame to milliseconds
- Operator in time-frame support
- Customisable outputs

# 🏓 Table of Contents

- [🤔 About](#-about)
- [Features](#features)
- [🏓 Table of Contents](#-table-of-contents)
- [📩 Installation](#-installation)
- [🧭 Comparison](#-comparison)
- [🌐 Languages](#-languages)
- [🍕 API](#-api)
- [Conversion](#conversion)
- [Globals](#globals)
- [🌀 Examples](#-examples)
- [Time-frame to Milliseconds](#time-frame-to-milliseconds)
- [Milliseconds to Time-frame](#milliseconds-to-time-frame)
- [Set Global Options](#set-global-options)
- [Set Global Language](#set-global-language)

# 📩 Installation

```bash
Expand Down
15 changes: 0 additions & 15 deletions babel.config.js

This file was deleted.

34 changes: 34 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
"files": {
"ignore": ["node_modules/*", "dist/*", ".next/*", "generated/*"]
},
"formatter": {
"enabled": true,
"indentStyle": "space",
"lineEnding": "lf"
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noNonNullAssertion": "off",
"noUselessElse": "off",
"noParameterAssign": "off",
"noCommaOperator": "off"
},
"suspicious": {
"noAssignInExpressions": "off",
"noArrayIndexKey": "off"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "single",
"jsxQuoteStyle": "double",
"semicolons": "always"
}
}
}
219 changes: 88 additions & 131 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,135 +1,92 @@
{
"name": "enhanced-ms",
"version": "2.3.0",
"license": "MIT",
"description": "Convert human readable time-frame strings to milliseconds and vice versa, with support for i10n and operators!",
"homepage": "https://github.com/apteryxxyz/enhanced-ms#readme",
"author": {
"name": "ApteryxXYZ",
"url": "https://apteryx.xyz"
"name": "enhanced-ms",
"version": "2.4.0-canary.1",
"license": "MIT",
"description": "Convert human readable time-frame strings to milliseconds and vice versa, with support for i10n and operators!",
"homepage": "https://github.com/apteryxxyz/enhanced-ms#readme",
"author": {
"name": "ApteryxXYZ",
"url": "https://apteryx.xyz"
},
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": ["dist"],
"exports": {
".": {
"import": "./dist/index.mjs",
"require": "./dist/index.js",
"types": "./dist/index.d.ts"
},
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist",
"!dist/*.js.map"
],
"scripts": {
"lint": "eslint src",
"format": "eslint src --fix && prettier src --write",
"test": "jest",
"build:compile": "tsc && webpack && rimraf temp",
"build:module": "gen-esm-wrapper . ./dist/index.mjs",
"build:fix-types": "node scripts/add-jsdoc.js",
"build": "pnpm build:compile && pnpm build:module && pnpm build:fix-types",
"prepare": "husky install"
},
"repository": {
"type": "git",
"url": "https://github.com/apteryxxyz/enhanced-ms"
},
"bugs": {
"url": "https://github.com/apteryxxyz/enhanced-ms/issues"
},
"keywords": [
"convert",
"duration",
"human",
"humanise",
"humanize",
"microseconds",
"milliseconds",
"ms",
"number",
"parse",
"period",
"pretty",
"print",
"range",
"readable",
"seconds",
"string",
"time"
],
"devDependencies": {
"@babel/core": "^7.21.5",
"@babel/preset-env": "^7.21.5",
"@babel/preset-typescript": "^7.21.5",
"@commitlint/cli": "^17.6.1",
"@commitlint/config-conventional": "^17.6.1",
"@rushstack/eslint-patch": "^1.2.0",
"@types/node": "^18.16.3",
"@typescript-eslint/eslint-plugin": "^5.59.2",
"@typescript-eslint/parser": "^5.59.2",
"babel-loader": "^9.1.2",
"benchmark": "^2.1.4",
"bundle-declarations-webpack-plugin": "^3.1.1",
"eslint": "^8.39.0",
"eslint-config-apteryx": "^2.0.6",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsdoc": "^41.1.2",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-sonarjs": "^0.19.0",
"eslint-plugin-typescript-sort-keys": "^2.3.0",
"eslint-plugin-unicorn": "^46.0.0",
"gen-esm-wrapper": "^1.1.3",
"husky": "^8.0.3",
"jest": "^29.5.0",
"prettier": "^2.8.8",
"prettier-config-apteryx": "^2.0.3",
"rimraf": "^5.0.0",
"ts-config-apteryx": "^2.0.0",
"typescript": "^5.0.4",
"webpack": "^5.81.0",
"webpack-cli": "^5.0.2"
},
"commitlint": {
"extends": [
"@commitlint/config-conventional"
],
"rules": {
"type-enum": [
2,
"always",
[
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
"types"
]
]
}
},
"prettier": "prettier-config-apteryx",
"eslintConfig": {
"extends": [
"apteryx/common",
"apteryx/typescript",
"apteryx/prettier"
],
"ignorePatterns": [
"test/*",
"examples/*",
"scripts/*",
"dist/*",
"temp/*",
"_src/*",
"*.config.js"
],
"rules": {
"id-length": "off"
}
"./package.json": {
"import": "./package.json",
"require": "./package.json"
}
},
"scripts": {
"lint": "biome lint .",
"format": "biome format --write .",
"build": "tsup",
"test": "jest",
"prepare": "husky install"
},
"repository": {
"type": "git",
"url": "https://github.com/apteryxxyz/enhanced-ms"
},
"bugs": {
"url": "https://github.com/apteryxxyz/enhanced-ms/issues"
},
"keywords": [
"convert",
"duration",
"human",
"humanise",
"humanize",
"microseconds",
"milliseconds",
"ms",
"number",
"parse",
"period",
"pretty",
"print",
"range",
"readable",
"seconds",
"string",
"time"
],
"devDependencies": {
"@biomejs/biome": "^1.5.3",
"@commitlint/cli": "^19.0.3",
"@commitlint/config-conventional": "^19.0.3",
"husky": "^9.0.11",
"jest": "^29.7.0",
"tsup": "^8.0.2",
"typescript": "^5.3.3"
},
"commitlint": {
"extends": ["@commitlint/config-conventional"],
"rules": {
"type-enum": [
2,
"always",
[
"build",
"chore",
"ci",
"docs",
"feat",
"fix",
"perf",
"refactor",
"revert",
"style",
"test",
"types"
]
]
}
}
}
Loading

0 comments on commit 3adf5c6

Please sign in to comment.