Compare commits
8 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c935b33bdc | |||
| 4e9ceb4f8e | |||
| 8f4bc779e2 | |||
| 543c0de865 | |||
| e9fc108432 | |||
| df607902d9 | |||
| b2f7ee70c6 | |||
| e453ba9a79 |
-138
@@ -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
|
|
||||||
@@ -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
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartmime",
|
"name": "@push.rocks/smartmime",
|
||||||
"version": "2.0.1",
|
"version": "2.0.4",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "A module for detecting MIME types with support for binary and text file distinctions.",
|
"description": "A module for detecting MIME types with support for binary and text file distinctions.",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@@ -13,16 +13,16 @@
|
|||||||
"buildDocs": "tsdoc"
|
"buildDocs": "tsdoc"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@git.zone/tsbuild": "^2.1.66",
|
"@git.zone/tsbuild": "^2.2.0",
|
||||||
"@git.zone/tsrun": "^1.2.44",
|
"@git.zone/tsrun": "^1.3.3",
|
||||||
"@git.zone/tstest": "^1.0.77",
|
"@git.zone/tstest": "^1.0.77",
|
||||||
"@push.rocks/tapbundle": "^5.0.8",
|
"@push.rocks/tapbundle": "^5.5.0",
|
||||||
"@types/node": "^20.12.12"
|
"@types/node": "^22.9.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/mime-types": "^2.1.4",
|
"@types/mime-types": "^2.1.4",
|
||||||
"file-type": "^19.0.0",
|
"file-type": "^19.6.0",
|
||||||
"mime": "^4.0.3"
|
"mime": "^4.0.4"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
@@ -48,5 +48,10 @@
|
|||||||
"text files",
|
"text files",
|
||||||
"file encoding",
|
"file encoding",
|
||||||
"mime types library"
|
"mime types library"
|
||||||
]
|
],
|
||||||
|
"homepage": "https://code.foss.global/push.rocks/smartmime",
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://code.foss.global/push.rocks/smartmime.git"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+3712
-397
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* autocreated commitinfo by @pushrocks/commitinfo
|
* autocreated commitinfo by @push.rocks/commitinfo
|
||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartmime',
|
name: '@push.rocks/smartmime',
|
||||||
version: '2.0.1',
|
version: '2.0.4',
|
||||||
description: 'A module for detecting MIME types with support for binary and text file distinctions.'
|
description: 'A module for detecting MIME types with support for binary and text file distinctions.'
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-1
@@ -3,6 +3,8 @@ import * as plugins from './smartmime.plugins.js';
|
|||||||
|
|
||||||
import { binaryMimeTypes } from './binary.js';
|
import { binaryMimeTypes } from './binary.js';
|
||||||
|
|
||||||
|
export type IFileTypeResult = plugins.fileType.FileTypeResult;
|
||||||
|
|
||||||
// TODO: evaluate where this is actually used
|
// TODO: evaluate where this is actually used
|
||||||
export const supportedFileTypes = ['json', 'html', 'svg', 'jpg', 'ts', 'js'];
|
export const supportedFileTypes = ['json', 'html', 'svg', 'jpg', 'ts', 'js'];
|
||||||
|
|
||||||
@@ -43,7 +45,7 @@ export const getEncoding = async (optionsArg: {
|
|||||||
/**
|
/**
|
||||||
* Synchronous version to get encoding based on the file extension
|
* Synchronous version to get encoding based on the file extension
|
||||||
*/
|
*/
|
||||||
export const getPathEncodingSync = (path: string): 'binary' | 'utf8' => {
|
export const getEncodingForPathSync = (path: string): 'binary' | 'utf8' => {
|
||||||
const mimeType = plugins.mime.getType(path);
|
const mimeType = plugins.mime.getType(path);
|
||||||
return binaryMimeTypes.includes(mimeType) ? 'binary' : 'utf8';
|
return binaryMimeTypes.includes(mimeType) ? 'binary' : 'utf8';
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user