pure-md5 0.1.14 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.aliases +19 -0
- package/.bash_profile +12 -0
- package/.bash_prompt +56 -0
- package/.changeset/README.md +32 -0
- package/.changeset/config.json +16 -0
- package/.continue/mcpServers/new-mcp-server.yaml +10 -0
- package/.continue/rules +29 -0
- package/.github/ISSUE_TEMPLATE/bug_report.md +35 -0
- package/.github/ISSUE_TEMPLATE/documentation.md +20 -0
- package/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +35 -0
- package/.github/workflows/npm-publish.yml +33 -0
- package/.github/workflows/release.yml +42 -0
- package/CHANGELOG.md +9 -0
- package/CONTRIBUTING.md +203 -0
- package/LICENSE.md +21 -0
- package/MIGRATION_GUIDE_STREAMS.md +374 -0
- package/README.md +274 -16
- package/STREAM_API.md +582 -0
- package/STREAM_BENCHMARKS.md +232 -0
- package/STREAM_EXAMPLES.md +669 -0
- package/STREAM_OPTIMIZATION_REPORT.md +136 -0
- package/STREAM_TROUBLESHOOTING.md +537 -0
- package/WEB_CRYPTO_TESTS_SUMMARY.md +140 -0
- package/WHATWG_STREAMS.md +191 -0
- package/__tests__/adapters/node-crypto.test.ts +167 -0
- package/__tests__/adapters/web-crypto-node.test.ts +73 -0
- package/__tests__/adapters/web-crypto.test.ts +195 -0
- package/__tests__/add32.test.ts +33 -0
- package/__tests__/fallback.test.ts +345 -0
- package/__tests__/hex.test.ts +38 -0
- package/__tests__/hex_chr.test.ts +20 -0
- package/__tests__/index.test.ts +87 -0
- package/__tests__/integration/fixtures/test-file.txt +1 -0
- package/__tests__/integration/md5-stream-file.test.ts +293 -0
- package/__tests__/integration/node-crypto-file.test.ts +86 -0
- package/__tests__/integration/web-crypto.test.ts +38 -0
- package/__tests__/md51.test.ts +73 -0
- package/__tests__/md5block.test.ts +61 -0
- package/__tests__/md5cycle.test.ts +48 -0
- package/__tests__/round-functions.test.ts +87 -0
- package/__tests__/stream/fs-utils.test.ts +209 -0
- package/__tests__/stream/md5-stream-edge-cases.test.ts +461 -0
- package/__tests__/stream/md5-stream.test.ts +418 -0
- package/__tests__/stream/whatwg-stream.test.ts +355 -0
- package/__tests__/stream/whatwg-stream.test.ts.bak2 +335 -0
- package/benchmarks/md5-stream.bench.ts +212 -0
- package/benchmarks/whatwg-stream.bench.ts +180 -0
- package/dist/adapters/ie11.cjs +2 -0
- package/dist/adapters/ie11.cjs.map +1 -0
- package/dist/adapters/ie11.d.cts +20 -0
- package/dist/adapters/ie11.d.ts +20 -0
- package/dist/adapters/ie11.js +2 -0
- package/dist/adapters/ie11.js.map +1 -0
- package/dist/adapters/node.cjs +2 -0
- package/dist/adapters/node.cjs.map +1 -0
- package/dist/adapters/node.d.cts +19 -0
- package/dist/adapters/node.d.ts +19 -0
- package/dist/adapters/node.js +2 -0
- package/dist/adapters/node.js.map +1 -0
- package/dist/adapters/webcrypto.cjs +2 -0
- package/dist/adapters/webcrypto.cjs.map +1 -0
- package/dist/adapters/webcrypto.d.cts +21 -0
- package/dist/adapters/webcrypto.d.ts +21 -0
- package/dist/adapters/webcrypto.js +2 -0
- package/dist/adapters/webcrypto.js.map +1 -0
- package/dist/chunk-2YXXFGBV.js +2 -0
- package/dist/chunk-2YXXFGBV.js.map +1 -0
- package/dist/chunk-4KSCMS4Q.js +2 -0
- package/dist/chunk-4KSCMS4Q.js.map +1 -0
- package/dist/chunk-6P2QV5SR.js +4 -0
- package/dist/chunk-6P2QV5SR.js.map +1 -0
- package/dist/chunk-G5WHEAIQ.js +2 -0
- package/dist/chunk-G5WHEAIQ.js.map +1 -0
- package/dist/chunk-H2K353LR.js +2 -0
- package/dist/chunk-H2K353LR.js.map +1 -0
- package/dist/chunk-JKVD5LHZ.js +2 -0
- package/dist/chunk-JKVD5LHZ.js.map +1 -0
- package/dist/chunk-NWQ4N5RX.js +2 -0
- package/dist/chunk-NWQ4N5RX.js.map +1 -0
- package/dist/chunk-PHZ7FTYF.js +2 -0
- package/dist/chunk-PHZ7FTYF.js.map +1 -0
- package/dist/chunk-PNZTVQA7.js +2 -0
- package/dist/chunk-PNZTVQA7.js.map +1 -0
- package/dist/chunk-R4JB5MBR.js +2 -0
- package/dist/chunk-R4JB5MBR.js.map +1 -0
- package/dist/chunk-VFOAY6XI.js +2 -0
- package/dist/chunk-VFOAY6XI.js.map +1 -0
- package/dist/chunk-XB5BQIEX.js +2 -0
- package/dist/chunk-XB5BQIEX.js.map +1 -0
- package/dist/core/index.cjs +2 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +19 -0
- package/dist/core/index.d.ts +19 -0
- package/dist/core/index.js +2 -0
- package/dist/core/index.js.map +1 -0
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +84 -0
- package/dist/index.d.ts +84 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/stream/adapter.cjs +2 -0
- package/dist/stream/adapter.cjs.map +1 -0
- package/dist/stream/adapter.d.cts +63 -0
- package/dist/stream/adapter.d.ts +63 -0
- package/dist/stream/adapter.js +2 -0
- package/dist/stream/adapter.js.map +1 -0
- package/dist/stream/fs-utils.cjs +2 -0
- package/dist/stream/fs-utils.cjs.map +1 -0
- package/dist/stream/fs-utils.d.cts +137 -0
- package/dist/stream/fs-utils.d.ts +137 -0
- package/dist/stream/fs-utils.js +2 -0
- package/dist/stream/fs-utils.js.map +1 -0
- package/dist/stream/index.cjs +2 -0
- package/dist/stream/index.cjs.map +1 -0
- package/dist/stream/index.d.cts +4 -0
- package/dist/stream/index.d.ts +4 -0
- package/dist/stream/index.js +2 -0
- package/dist/stream/index.js.map +1 -0
- package/dist/stream/light/index.cjs +2 -0
- package/dist/stream/light/index.cjs.map +1 -0
- package/dist/stream/light/index.d.cts +4 -0
- package/dist/stream/light/index.d.ts +4 -0
- package/dist/stream/light/index.js +2 -0
- package/dist/stream/light/index.js.map +1 -0
- package/dist/stream/md5-stream.cjs +2 -0
- package/dist/stream/md5-stream.cjs.map +1 -0
- package/dist/stream/md5-stream.d.cts +123 -0
- package/dist/stream/md5-stream.d.ts +123 -0
- package/dist/stream/md5-stream.js +2 -0
- package/dist/stream/md5-stream.js.map +1 -0
- package/dist/stream/whatwg-stream.cjs +2 -0
- package/dist/stream/whatwg-stream.cjs.map +1 -0
- package/dist/stream/whatwg-stream.d.cts +185 -0
- package/dist/stream/whatwg-stream.d.ts +185 -0
- package/dist/stream/whatwg-stream.js +2 -0
- package/dist/stream/whatwg-stream.js.map +1 -0
- package/dist/types-edGoGJ5V.d.cts +42 -0
- package/dist/types-edGoGJ5V.d.ts +42 -0
- package/dist/utils/detect.cjs +4 -0
- package/dist/utils/detect.cjs.map +1 -0
- package/dist/utils/detect.d.cts +110 -0
- package/dist/utils/detect.d.ts +110 -0
- package/dist/utils/detect.js +2 -0
- package/dist/utils/detect.js.map +1 -0
- package/package.json +76 -22
- package/planning/03-optimization-size-tree-shaking/01-es-modules-tree-shaking.md +152 -0
- package/planning/03-optimization-size-tree-shaking/02-consolidate-modules.md +65 -0
- package/planning/03-optimization-size-tree-shaking/03-remove-duplicate-add32.md +93 -0
- package/planning/03-optimization-size-tree-shaking/04-remove-runtime-check.md +102 -0
- package/planning/03-optimization-size-tree-shaking/05-optimize-loops-performance.md +107 -0
- package/planning/03-optimization-size-tree-shaking/06-tsup-formats-configuration.md +227 -0
- package/planning/03-optimization-size-tree-shaking/07-multiple-build-formats.md +228 -0
- package/planning/03-optimization-size-tree-shaking/08-benchmarks-metrics.md +34 -0
- package/planning/03-optimization-size-tree-shaking/MIGRATION_GUIDE.md +260 -0
- package/planning/03-optimization-size-tree-shaking/README.md +173 -0
- package/planning/03-optimization-size-tree-shaking/SUMMARY.md +168 -0
- package/planning/04-adapter-backend/03-backend-web-crypto.md +149 -0
- package/planning/04-adapter-backend/04-backend-node-crypto.md +181 -0
- package/planning/04-adapter-backend/05-backend-pure-js.md +174 -0
- package/planning/04-adapter-backend/06-backend-ie11.md +158 -0
- package/planning/04-adapter-backend/07-detection-environment.md +232 -0
- package/planning/04-adapter-backend/08-detection-backend.md +210 -0
- package/planning/04-adapter-backend/09-adapter-unified.md +255 -0
- package/planning/04-adapter-backend/10-fallback-mechanism.md +333 -0
- package/planning/04-adapter-backend/11-tests-backend-web-crypto.md +191 -0
- package/planning/04-adapter-backend/12-tests-backend-node-crypto.md +222 -0
- package/planning/04-adapter-backend/README.md +45 -0
- package/planning/05-documentation-publishing/01-README-optimization.md +105 -0
- package/planning/05-documentation-publishing/02-VitePress-site-evaluation.md +136 -0
- package/planning/05-documentation-publishing/03-Changeset-setup.md +192 -0
- package/planning/05-documentation-publishing/04-GitHub-templates.md +252 -0
- package/planning/05-documentation-publishing/README.md +22 -0
- package/planning/05-documentation-publishing/STATUS.md +222 -0
- package/planning/prd.md +405 -0
- package/planning/streams/01-create-md5stream-class.md +69 -0
- package/planning/streams/02-create-factory-api.md +65 -0
- package/planning/streams/03-fs-integration.md +37 -0
- package/planning/streams/04-whatwg-streams-support.md +37 -0
- package/planning/streams/05-audit-optimization.md +121 -0
- package/planning/streams/06-comprehensive-tests-docs.md +137 -0
- package/planning/streams/07-architecture-integration.md +38 -0
- package/planning/streams/README.md +98 -0
- package/tsup.config.ts +24 -0
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -2
- package/lib/index.js.map +0 -1
package/.aliases
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Detect which `ls` flavor is in use
|
|
2
|
+
if ls --color > /dev/null 2>&1; then # GNU `ls`
|
|
3
|
+
colorflag="--color"
|
|
4
|
+
else # OS X `ls`
|
|
5
|
+
colorflag="-G"
|
|
6
|
+
fi
|
|
7
|
+
|
|
8
|
+
# List all files colorized in long format
|
|
9
|
+
alias ll='ls -lh'
|
|
10
|
+
|
|
11
|
+
# List all files colorized in long format, including dot files
|
|
12
|
+
alias la="ls -lha"
|
|
13
|
+
|
|
14
|
+
# List only directories
|
|
15
|
+
alias lsd='ls -l | grep "^d"'
|
|
16
|
+
|
|
17
|
+
# Always use color output for `ls`
|
|
18
|
+
alias ls="command ls ${colorflag}"
|
|
19
|
+
export LS_COLORS='no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
|
package/.bash_profile
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Add Homebrew `/usr/local/bin` and User `~/bin` to the `$PATH`
|
|
2
|
+
PATH=/usr/local/bin:$PATH
|
|
3
|
+
PATH=$HOME/bin:$PATH
|
|
4
|
+
export PATH
|
|
5
|
+
|
|
6
|
+
# Load the shell dotfiles, and then some:
|
|
7
|
+
# * ~/.path can be used to extend `$PATH`.
|
|
8
|
+
# * ~/.extra can be used for other settings you don’t want to commit.
|
|
9
|
+
for file in ~/.{path,bash_prompt,exports,aliases,functions,extra}; do
|
|
10
|
+
[ -r "$file" ] && source "$file"
|
|
11
|
+
done
|
|
12
|
+
unset file
|
package/.bash_prompt
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt”
|
|
2
|
+
# Shamelessly copied from https://github.com/gf3/dotfiles
|
|
3
|
+
# Screenshot: http://i.imgur.com/s0Blh.png
|
|
4
|
+
|
|
5
|
+
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
|
|
6
|
+
export TERM=gnome-256color
|
|
7
|
+
elif infocmp xterm-256color >/dev/null 2>&1; then
|
|
8
|
+
export TERM=xterm-256color
|
|
9
|
+
fi
|
|
10
|
+
|
|
11
|
+
if tput setaf 1 &> /dev/null; then
|
|
12
|
+
tput sgr0
|
|
13
|
+
if [[ $(tput colors) -ge 256 ]] 2>/dev/null; then
|
|
14
|
+
# Changed these colors to fit Solarized theme
|
|
15
|
+
MAGENTA=$(tput setaf 125)
|
|
16
|
+
ORANGE=$(tput setaf 166)
|
|
17
|
+
GREEN=$(tput setaf 64)
|
|
18
|
+
PURPLE=$(tput setaf 61)
|
|
19
|
+
WHITE=$(tput setaf 244)
|
|
20
|
+
else
|
|
21
|
+
MAGENTA=$(tput setaf 5)
|
|
22
|
+
ORANGE=$(tput setaf 4)
|
|
23
|
+
GREEN=$(tput setaf 2)
|
|
24
|
+
PURPLE=$(tput setaf 1)
|
|
25
|
+
WHITE=$(tput setaf 7)
|
|
26
|
+
fi
|
|
27
|
+
BOLD=$(tput bold)
|
|
28
|
+
RESET=$(tput sgr0)
|
|
29
|
+
else
|
|
30
|
+
MAGENTA="\033[1;31m"
|
|
31
|
+
ORANGE="\033[1;33m"
|
|
32
|
+
GREEN="\033[1;32m"
|
|
33
|
+
PURPLE="\033[1;35m"
|
|
34
|
+
WHITE="\033[1;37m"
|
|
35
|
+
BOLD=""
|
|
36
|
+
RESET="\033[m"
|
|
37
|
+
fi
|
|
38
|
+
|
|
39
|
+
export MAGENTA
|
|
40
|
+
export ORANGE
|
|
41
|
+
export GREEN
|
|
42
|
+
export PURPLE
|
|
43
|
+
export WHITE
|
|
44
|
+
export BOLD
|
|
45
|
+
export RESET
|
|
46
|
+
|
|
47
|
+
function parse_git_dirty() {
|
|
48
|
+
[[ $(git status 2> /dev/null | tail -n1) != *"working directory clean"* ]] && echo "*"
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function parse_git_branch() {
|
|
52
|
+
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/\1$(parse_git_dirty)/"
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export PS1="\[${BOLD}${MAGENTA}\]\u \[$WHITE\]at \[$ORANGE\]\h \[$WHITE\]in \[$GREEN\]\w\[$WHITE\]\$([[ -n \$(git branch 2> /dev/null) ]] && echo \" on \")\[$PURPLE\]\$(parse_git_branch)\[$WHITE\]\n\$ \[$RESET\]"
|
|
56
|
+
export PS2="\[$ORANGE\]→ \[$RESET\]"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Changesets
|
|
2
|
+
|
|
3
|
+
This is a monorepo using [Changesets](https://github.com/changesets/changesets).
|
|
4
|
+
|
|
5
|
+
## Adding a changeset
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm run changeset
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
You will be prompted to:
|
|
12
|
+
|
|
13
|
+
1. Select which packages to include
|
|
14
|
+
2. Select the type of change (major, minor, patch)
|
|
15
|
+
3. Write a summary of the change
|
|
16
|
+
|
|
17
|
+
This will create a new file in the `.changeset` directory. Commit this file to your branch.
|
|
18
|
+
|
|
19
|
+
## Versioning and Publishing
|
|
20
|
+
|
|
21
|
+
When ready to release:
|
|
22
|
+
|
|
23
|
+
1. Merge changes to `main` branch
|
|
24
|
+
2. GitHub Actions will create a release PR
|
|
25
|
+
3. Review and merge the release PR
|
|
26
|
+
4. GitHub Actions will publish to npm and create GitHub releases
|
|
27
|
+
|
|
28
|
+
## Configuration
|
|
29
|
+
|
|
30
|
+
- **Base Branch**: `main`
|
|
31
|
+
- **Access**: Public
|
|
32
|
+
- **Version Updates**: Patch for internal dependencies
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/@changesets/config@2.3.0/schema.json",
|
|
3
|
+
"changelog": [
|
|
4
|
+
"@changesets/changelog-github",
|
|
5
|
+
{
|
|
6
|
+
"repo": "eustatos/pure-md5"
|
|
7
|
+
}
|
|
8
|
+
],
|
|
9
|
+
"commit": false,
|
|
10
|
+
"fixed": [],
|
|
11
|
+
"linked": [],
|
|
12
|
+
"access": "public",
|
|
13
|
+
"baseBranch": "main",
|
|
14
|
+
"updateInternalDependencies": "patch",
|
|
15
|
+
"ignore": []
|
|
16
|
+
}
|
package/.continue/rules
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# Project Style Rules
|
|
2
|
+
|
|
3
|
+
## Language Policy
|
|
4
|
+
|
|
5
|
+
**All documentation, commits, and comments must be written in English.**
|
|
6
|
+
|
|
7
|
+
### Commit Messages
|
|
8
|
+
- Use clear, descriptive commit messages in English
|
|
9
|
+
- Follow conventional commit format when applicable:
|
|
10
|
+
```
|
|
11
|
+
feat: add streaming support for large files
|
|
12
|
+
fix: correct md5 block padding calculation
|
|
13
|
+
docs: update installation instructions
|
|
14
|
+
test: add coverage for edge cases
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
### Code Comments
|
|
18
|
+
- Write all comments in English
|
|
19
|
+
- Use clear, descriptive variable and function names
|
|
20
|
+
- Include JSDoc/type descriptions in English for all public APIs
|
|
21
|
+
|
|
22
|
+
### Documentation
|
|
23
|
+
- Write all documentation in English
|
|
24
|
+
- Include English examples showing expected input/output
|
|
25
|
+
- Keep README files and guides in English
|
|
26
|
+
|
|
27
|
+
### Pull Requests
|
|
28
|
+
- Describe changes in English
|
|
29
|
+
- Reference issues using proper syntax (e.g., `Fixes #123`)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug Report
|
|
3
|
+
about: Create a report to help us improve
|
|
4
|
+
title: "[BUG] "
|
|
5
|
+
labels: bug
|
|
6
|
+
assignees: ""
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the bug**
|
|
11
|
+
A clear and concise description of what the bug is.
|
|
12
|
+
|
|
13
|
+
**To Reproduce**
|
|
14
|
+
Steps to reproduce the behavior:
|
|
15
|
+
1. Go to '...'
|
|
16
|
+
2. Click on '....'
|
|
17
|
+
3. Scroll down to '....'
|
|
18
|
+
4. See error
|
|
19
|
+
|
|
20
|
+
**Code Example**
|
|
21
|
+
```javascript
|
|
22
|
+
// Code that reproduces the issue
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
**Expected behavior**
|
|
26
|
+
A clear and concise description of what you expected to happen.
|
|
27
|
+
|
|
28
|
+
**Environment:**
|
|
29
|
+
- OS: [e.g. macOS, Windows, Linux]
|
|
30
|
+
- Node.js version: [e.g. 14, 16, 18]
|
|
31
|
+
- Package version: [e.g. 0.1.0]
|
|
32
|
+
- Browser (if applicable): [e.g. chrome, safari]
|
|
33
|
+
|
|
34
|
+
**Additional context**
|
|
35
|
+
Add any other context about the problem here.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Documentation Update
|
|
3
|
+
about: Improve documentation
|
|
4
|
+
title: "[DOCS] "
|
|
5
|
+
labels: documentation
|
|
6
|
+
assignees: ""
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe what the documentation should cover:**
|
|
11
|
+
A clear and concise description of what topics should be included.
|
|
12
|
+
|
|
13
|
+
**Current state:**
|
|
14
|
+
What is currently documented?
|
|
15
|
+
|
|
16
|
+
**Proposed changes:**
|
|
17
|
+
Describe the improvements to the documentation.
|
|
18
|
+
|
|
19
|
+
**Additional context:**
|
|
20
|
+
Add any other context about the documentation update.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature Request
|
|
3
|
+
about: Suggest an idea for this project
|
|
4
|
+
title: "[FEATURE] "
|
|
5
|
+
labels: enhancement
|
|
6
|
+
assignees: ""
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Is your feature request related to a problem? Please describe.**
|
|
11
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
12
|
+
|
|
13
|
+
**Describe the solution you'd like**
|
|
14
|
+
A clear and concise description of what you want to happen.
|
|
15
|
+
|
|
16
|
+
**Describe alternatives you've considered**
|
|
17
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
|
18
|
+
|
|
19
|
+
**Additional context**
|
|
20
|
+
Add any other context or screenshots about the feature request here.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
## Description
|
|
2
|
+
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
|
|
3
|
+
|
|
4
|
+
Fixes # (issue)
|
|
5
|
+
|
|
6
|
+
## Type of change
|
|
7
|
+
Please delete options that are not relevant.
|
|
8
|
+
|
|
9
|
+
- [ ] Bug fix (non-breaking change which fixes an issue)
|
|
10
|
+
- [ ] New feature (non-breaking change which adds functionality)
|
|
11
|
+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
|
12
|
+
- [ ] This change requires a documentation update
|
|
13
|
+
|
|
14
|
+
## How Has This Been Tested?
|
|
15
|
+
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
|
|
16
|
+
|
|
17
|
+
```javascript
|
|
18
|
+
// Test code
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
**Test Configuration**:
|
|
22
|
+
* Node.js version:
|
|
23
|
+
* OS:
|
|
24
|
+
|
|
25
|
+
## Checklist:
|
|
26
|
+
- [ ] My code follows the style guidelines of this project
|
|
27
|
+
- [ ] I have performed a self-review of my own code
|
|
28
|
+
- [ ] I have commented my code, particularly in hard-to-understand areas
|
|
29
|
+
- [ ] I have made corresponding changes to the documentation
|
|
30
|
+
- [ ] My changes generate no new warnings
|
|
31
|
+
- [ ] I have added tests that prove my fix is effective or that my feature works
|
|
32
|
+
- [ ] New and existing unit tests pass locally with my changes
|
|
33
|
+
- [ ] Any dependent changes have been merged and published in downstream modules
|
|
34
|
+
|
|
35
|
+
## Screenshots (if appropriate):
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
|
|
2
|
+
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
|
|
3
|
+
|
|
4
|
+
name: Node.js Package
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
release:
|
|
8
|
+
types: [created]
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
build:
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v3
|
|
15
|
+
- uses: actions/setup-node@v3
|
|
16
|
+
with:
|
|
17
|
+
node-version: 16
|
|
18
|
+
- run: npm ci
|
|
19
|
+
- run: npm test
|
|
20
|
+
|
|
21
|
+
publish-npm:
|
|
22
|
+
needs: build
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v3
|
|
26
|
+
- uses: actions/setup-node@v3
|
|
27
|
+
with:
|
|
28
|
+
node-version: 16
|
|
29
|
+
registry-url: https://registry.npmjs.org/
|
|
30
|
+
- run: npm ci
|
|
31
|
+
- run: npm publish
|
|
32
|
+
env:
|
|
33
|
+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
name: Release
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
release:
|
|
10
|
+
name: Release
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- name: Checkout Repo
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
with:
|
|
16
|
+
fetch-depth: 0
|
|
17
|
+
|
|
18
|
+
- name: Setup Node.js
|
|
19
|
+
uses: actions/setup-node@v4
|
|
20
|
+
with:
|
|
21
|
+
node-version: 20
|
|
22
|
+
|
|
23
|
+
- name: Install Dependencies
|
|
24
|
+
run: npm ci
|
|
25
|
+
|
|
26
|
+
- name: Build
|
|
27
|
+
run: npm run build
|
|
28
|
+
|
|
29
|
+
- name: Test
|
|
30
|
+
run: npm test
|
|
31
|
+
|
|
32
|
+
- name: Create Release Pull Request
|
|
33
|
+
id: changeset
|
|
34
|
+
uses: changesets/action@v1
|
|
35
|
+
with:
|
|
36
|
+
version: npm run ci && npm run changeset:version
|
|
37
|
+
publish: npm run ci && npm run changeset:publish
|
|
38
|
+
commit: "chore: update versions"
|
|
39
|
+
title: "chore: version packages"
|
|
40
|
+
env:
|
|
41
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
42
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
package/CHANGELOG.md
ADDED
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# Contributing to pure-md5
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing to pure-md5! 🎉
|
|
4
|
+
|
|
5
|
+
## Table of Contents
|
|
6
|
+
|
|
7
|
+
- [Code of Conduct](#code-of-conduct)
|
|
8
|
+
- [How Can I Contribute?](#how-can-i-contribute)
|
|
9
|
+
- [Development Setup](#development-setup)
|
|
10
|
+
- [Running Tests](#running-tests)
|
|
11
|
+
- [Creating Changesets](#creating-changesets)
|
|
12
|
+
- [Pull Request Process](#pull-request-process)
|
|
13
|
+
- [Coding Standards](#coding-standards)
|
|
14
|
+
|
|
15
|
+
## Code of Conduct
|
|
16
|
+
|
|
17
|
+
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
|
|
18
|
+
|
|
19
|
+
## How Can I Contribute?
|
|
20
|
+
|
|
21
|
+
### Reporting Bugs
|
|
22
|
+
|
|
23
|
+
Before creating bug reports, please check the existing issues to avoid duplicates. When you create a bug report, please include as many details as possible:
|
|
24
|
+
|
|
25
|
+
- A clear, descriptive title
|
|
26
|
+
- Steps to reproduce the issue
|
|
27
|
+
- Expected behavior
|
|
28
|
+
- Actual behavior
|
|
29
|
+
- Environment details (OS, Node.js version, package version)
|
|
30
|
+
- Code example that reproduces the issue
|
|
31
|
+
|
|
32
|
+
### Suggesting Features
|
|
33
|
+
|
|
34
|
+
Feature requests are welcome! Please provide:
|
|
35
|
+
|
|
36
|
+
- A clear description of the feature
|
|
37
|
+
- The problem it solves
|
|
38
|
+
- Any alternative solutions you've considered
|
|
39
|
+
- Examples of how the feature would be used
|
|
40
|
+
|
|
41
|
+
### Pull Requests
|
|
42
|
+
|
|
43
|
+
1. Fork the repository
|
|
44
|
+
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
|
|
45
|
+
3. Make your changes
|
|
46
|
+
4. Run tests (`npm test`)
|
|
47
|
+
5. Create a changeset (`npx changeset`)
|
|
48
|
+
6. Push your branch (`git push origin feature/amazing-feature`)
|
|
49
|
+
7. Open a Pull Request
|
|
50
|
+
|
|
51
|
+
## Development Setup
|
|
52
|
+
|
|
53
|
+
### Prerequisites
|
|
54
|
+
|
|
55
|
+
- Node.js >= 16
|
|
56
|
+
- npm >= 8
|
|
57
|
+
|
|
58
|
+
### Installation
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Fork the repository first
|
|
62
|
+
git clone https://github.com/eustatos/pure-md5.git
|
|
63
|
+
cd pure-md5
|
|
64
|
+
|
|
65
|
+
# Install dependencies
|
|
66
|
+
npm install
|
|
67
|
+
|
|
68
|
+
# Build the project
|
|
69
|
+
npm run build
|
|
70
|
+
|
|
71
|
+
# Run tests
|
|
72
|
+
npm test
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Available Scripts
|
|
76
|
+
|
|
77
|
+
| Command | Description |
|
|
78
|
+
|---------|-------------|
|
|
79
|
+
| `npm run build` | Build the project |
|
|
80
|
+
| `npm run build:watch` | Build in watch mode |
|
|
81
|
+
| `npm run build:prod` | Build with minification |
|
|
82
|
+
| `npm run dev` | Run in dev mode |
|
|
83
|
+
| `npm test` | Run all tests |
|
|
84
|
+
| `npm run coverage` | Generate coverage report |
|
|
85
|
+
| `npx changeset` | Create a changeset |
|
|
86
|
+
|
|
87
|
+
## Running Tests
|
|
88
|
+
|
|
89
|
+
### All Tests
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
npm test
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Specific Test File
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
npm test __tests__/index.test.ts
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### With Coverage
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
npm run coverage
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Watch Mode
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
npm test -- --watch
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Creating Changesets
|
|
114
|
+
|
|
115
|
+
Changesets are used to manage versioning and changelog generation.
|
|
116
|
+
|
|
117
|
+
### Creating a Changeset
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
npx changeset
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
This will prompt you to:
|
|
124
|
+
|
|
125
|
+
1. Select the version bump type:
|
|
126
|
+
- `major` - Breaking changes
|
|
127
|
+
- `minor` - New features
|
|
128
|
+
- `patch` - Bug fixes
|
|
129
|
+
|
|
130
|
+
2. Write a description of your changes
|
|
131
|
+
|
|
132
|
+
### Example
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
? Which packages would you like to include in this changeset? pure-md5
|
|
136
|
+
? Which type of change is this?
|
|
137
|
+
patch Patch release (bug fixes)
|
|
138
|
+
minor Minor release (new features)
|
|
139
|
+
major Major release (breaking changes)
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Pull Request Process
|
|
143
|
+
|
|
144
|
+
1. **Update Documentation**: Update README.md or other docs if needed
|
|
145
|
+
2. **Run Tests**: Ensure all tests pass
|
|
146
|
+
3. **Code Review**: Wait for review from maintainers
|
|
147
|
+
4. **Address Feedback**: Make requested changes
|
|
148
|
+
5. **Merge**: Maintainers will merge when approved
|
|
149
|
+
|
|
150
|
+
### PR Title Format
|
|
151
|
+
|
|
152
|
+
Use conventional commit format:
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
type: description
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Types:
|
|
159
|
+
- `feat`: New feature
|
|
160
|
+
- `fix`: Bug fix
|
|
161
|
+
- `docs`: Documentation changes
|
|
162
|
+
- `style`: Code style changes
|
|
163
|
+
- `refactor`: Code refactoring
|
|
164
|
+
- `perf`: Performance improvements
|
|
165
|
+
- `test`: Adding tests
|
|
166
|
+
- `chore`: Maintenance tasks
|
|
167
|
+
|
|
168
|
+
Examples:
|
|
169
|
+
```
|
|
170
|
+
feat: add streaming API for large files
|
|
171
|
+
fix: handle edge case in MD5 calculation
|
|
172
|
+
docs: update installation instructions
|
|
173
|
+
refactor: optimize performance
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Coding Standards
|
|
177
|
+
|
|
178
|
+
### JavaScript/TypeScript
|
|
179
|
+
|
|
180
|
+
- Use ES6+ features
|
|
181
|
+
- Follow Airbnb JavaScript Style Guide
|
|
182
|
+
- Use TypeScript for new code
|
|
183
|
+
- Add JSDoc comments for public APIs
|
|
184
|
+
|
|
185
|
+
### Commit Messages
|
|
186
|
+
|
|
187
|
+
- Use conventional commits
|
|
188
|
+
- Use present tense
|
|
189
|
+
- Be descriptive but concise
|
|
190
|
+
|
|
191
|
+
### File Structure
|
|
192
|
+
|
|
193
|
+
- Place tests in `__tests__/` directory
|
|
194
|
+
- Name test files `<module>.test.ts`
|
|
195
|
+
- Keep files focused on single responsibility
|
|
196
|
+
|
|
197
|
+
## Questions?
|
|
198
|
+
|
|
199
|
+
Feel free to open an issue or ask in the pull request if you have questions!
|
|
200
|
+
|
|
201
|
+
## Acknowledgments
|
|
202
|
+
|
|
203
|
+
Thank you for contributing to pure-md5! 🙏
|
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 eustatos
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|