10 Commits

Author SHA1 Message Date
jkunz c935b33bdc chore: remove .gitlab-ci.yml 2026-03-01 18:57:02 +00:00
philkunz 4e9ceb4f8e 2.0.4 2024-11-18 15:04:07 +01:00
philkunz 8f4bc779e2 fix(core): Documentation and test coverage updates 2024-11-18 15:04:07 +01:00
philkunz 543c0de865 2.0.3 2024-11-18 15:03:40 +01:00
philkunz e9fc108432 fix(core): Update dependencies and optimize type imports 2024-11-18 15:03:40 +01:00
philkunz df607902d9 update description 2024-05-29 14:14:46 +02:00
philkunz b2f7ee70c6 2.0.2 2024-05-28 12:42:26 +02:00
philkunz e453ba9a79 fix(core): update 2024-05-28 12:42:25 +02:00
philkunz a384a6ac0a 2.0.1 2024-05-28 11:52:26 +02:00
philkunz 080abb0138 fix(core): update 2024-05-28 11:52:26 +02:00
6 changed files with 3779 additions and 545 deletions
-138
View File
@@ -1,138 +0,0 @@
# gitzone ci_default
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
cache:
paths:
- .npmci_cache/
key: '$CI_BUILD_STAGE'
stages:
- security
- test
- release
- metadata
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci git mirror
only:
- tags
tags:
- lossless
- docker
- notpriv
auditProductionDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --production --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
allow_failure: true
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
stage: security
script:
- npmci npm prepare
- npmci command npm install --ignore-scripts
- npmci command npm config set registry https://registry.npmjs.org
- npmci command npm audit --audit-level=high --only=dev
tags:
- docker
allow_failure: true
# ====================
# test stage
# ====================
testStable:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
release:
stage: release
script:
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- lossless
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
allow_failure: true
only:
- tags
script:
- npmci command npm install -g tslint typescript
- npmci npm prepare
- npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags:
- lossless
- docker
- priv
trigger:
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- lossless
- docker
- notpriv
pages:
stage: metadata
script:
- npmci node install lts
- npmci command npm install -g @git.zone/tsdoc
- npmci npm prepare
- npmci npm install
- npmci command tsdoc
tags:
- lossless
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true
+42
View File
@@ -0,0 +1,42 @@
# Changelog
## 2024-11-18 - 2.0.4 - fix(core)
Documentation and test coverage updates
- Comprehensive examples added to readme.md.
- Expanded test coverage for mime type detection.
## 2024-11-18 - 2.0.3 - fix(core)
Update dependencies and optimize type imports
- Updated devDependencies: '@git.zone/tsbuild', '@git.zone/tsrun', '@push.rocks/tapbundle', and '@types/node'.
- Updated dependencies: 'file-type' and 'mime'.
- Optimized import for IFileTypeResult type from plugins.fileType.
## 2024-05-29 - 2.0.2 - Documentation Update
Improvements in project documentation details.
- Updated project description for better clarity.
## 2024-05-21 - 2.0.0 to 2.0.1 - Core Updates and Fixes
Updates in core functionalities and maintenance fixes.
- Fixed issues within core components through multiple updates.
- Addressed breaking change in core functionality, necessitating updates across dependent modules.
## 2023-07-11 - 1.0.5 to 1.0.6 - Organizational and Configuration Changes
Switched to a new organizational scheme and updated configurations.
- Implemented switch to a new organizational scheme.
- Updated npmextra.json configuration for githost.
- Updated tsconfig to reflect changes in project setup.
## 2021-08-10 - 1.0.4 and 1.0.3 - Core Updates
Necessary modifications to core components.
- Applied fixes in core components spanning multiple versions.
## 2020-03-04 - 1.0.1 to 1.0.2 - Core Component Fixes
Initial fixes in core modules.
- Resolved initial bugs and issues present in core functionalities of the system.
+13 -8
View File
@@ -1,6 +1,6 @@
{
"name": "@push.rocks/smartmime",
"version": "2.0.0",
"version": "2.0.4",
"private": false,
"description": "A module for detecting MIME types with support for binary and text file distinctions.",
"main": "dist_ts/index.js",
@@ -13,16 +13,16 @@
"buildDocs": "tsdoc"
},
"devDependencies": {
"@git.zone/tsbuild": "^2.1.66",
"@git.zone/tsrun": "^1.2.44",
"@git.zone/tsbuild": "^2.2.0",
"@git.zone/tsrun": "^1.3.3",
"@git.zone/tstest": "^1.0.77",
"@push.rocks/tapbundle": "^5.0.8",
"@types/node": "^20.12.12"
"@push.rocks/tapbundle": "^5.5.0",
"@types/node": "^22.9.0"
},
"dependencies": {
"@types/mime-types": "^2.1.4",
"file-type": "^19.0.0",
"mime": "^4.0.3"
"file-type": "^19.6.0",
"mime": "^4.0.4"
},
"files": [
"ts/**/*",
@@ -48,5 +48,10 @@
"text files",
"file encoding",
"mime types library"
]
],
"homepage": "https://code.foss.global/push.rocks/smartmime",
"repository": {
"type": "git",
"url": "https://code.foss.global/push.rocks/smartmime.git"
}
}
+3712 -397
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -1,8 +1,8 @@
/**
* autocreated commitinfo by @pushrocks/commitinfo
* autocreated commitinfo by @push.rocks/commitinfo
*/
export const commitinfo = {
name: '@push.rocks/smartmime',
version: '2.0.0',
version: '2.0.4',
description: 'A module for detecting MIME types with support for binary and text file distinctions.'
}
+10
View File
@@ -3,6 +3,8 @@ import * as plugins from './smartmime.plugins.js';
import { binaryMimeTypes } from './binary.js';
export type IFileTypeResult = plugins.fileType.FileTypeResult;
// TODO: evaluate where this is actually used
export const supportedFileTypes = ['json', 'html', 'svg', 'jpg', 'ts', 'js'];
@@ -39,3 +41,11 @@ export const getEncoding = async (optionsArg: {
}) => {
return (await isBinary(optionsArg)) ? 'binary' : 'utf8';
};
/**
* Synchronous version to get encoding based on the file extension
*/
export const getEncodingForPathSync = (path: string): 'binary' | 'utf8' => {
const mimeType = plugins.mime.getType(path);
return binaryMimeTypes.includes(mimeType) ? 'binary' : 'utf8';
};