This document summarizes all changes made to prepare the fints project for npm publication.
The request was to:
- Prepare the project for npm publication via GitHub Actions
- Publish under the names
fints-libandfints-lib-cli - Update the README to reflect these changes
- Acknowledge the original repository and author
- Highlight the improvements
- Update dependencies to a good state
fints→fints-lib(Core library)fints-cli→fints-lib-cli(Command-line interface)- Updated package.json files for both packages
- Updated all import statements and documentation
- Changed CLI binary command from
fintstofints-lib
Created two workflows in .github/workflows/:
- Triggers on GitHub releases or manual workflow dispatch
- Builds both packages
- Publishes to npm with provenance
- Supports publishing individual packages or both
- Uses
NPM_TOKENsecret for authentication
- Runs on push to master and pull requests
- Tests on Node.js 18 and 20
- Runs linting, building, and testing
- Configured with minimal permissions for security
- Added prominent acknowledgment of Frederick Gnodtke (Prior99) and the original repository
- Created "Improvements in this Fork" section highlighting:
- Updated dependencies
- Modern TypeScript 5.x
- GitHub Actions CI/CD
- Active maintenance
- New package names
- Added installation instructions
- Added quick start examples for both library and CLI
- Updated badges for npm and CI status
- Updated packages/fints/README.md with new package name
- Updated packages/fints-cli/README.md with new package name
- Changed all import examples to use
fints-lib - Updated CLI command examples to use
fints-lib
- iconv-lite v0.7.x: Updated imports from named exports to default export
- Changed
import { encode, decode }toimport iconv - Updated all usage to
iconv.encode()andiconv.decode()
- Changed
- minimatch: Added as devDependency to resolve @types/minimatch deprecation
- node-gyp: Updated to latest version to fix build issues
- Fixed TypeScript 5.x syntax errors (trailing commas before rest parameters)
- Split long import lines to meet 120-character limit
- Updated tslint configuration with
esSpecCompliant: true - Fixed all linting errors
- Created
PUBLISHING.mdwith comprehensive publishing guide:- How to set up NPM_TOKEN
- Publishing via GitHub releases (recommended)
- Manual publishing via workflow dispatch
- Version numbering guidelines
- Pre-publishing checklist
- Troubleshooting guide
- Added
.npmignorefiles to both packages - Enhanced package.json metadata:
- Added more keywords (psd2, sepa, mt940, pain.001, pain.008, german-banking)
- Added Lars Decker as contributor
- Updated repository URLs to larsdecker/fints
- Verified with
npm pack --dry-runfor both packages - Ensured only distribution files are included
- Verified CLI shebang and executable permissions
- fints-lib: 200 tests passing, 87.56% statement coverage
- fints-lib-cli: 5 tests passing
- Total: 205 tests, all passing
- Both packages build successfully
- Generated TypeScript definitions are correct
- CLI binary is executable
- CodeQL security scan: 0 vulnerabilities
- Fixed GitHub Actions permission issues
- All workflows use minimal necessary permissions
.github/workflows/ci.yml- CI workflow.github/workflows/publish.yml- Publishing workflowPUBLISHING.md- Publishing documentationpackages/fints/.npmignore- npm package exclusionspackages/fints-cli/.npmignore- npm package exclusions
README.md- Complete rewrite with acknowledgments and improvementspackages/fints/README.md- Updated for new package namepackages/fints-cli/README.md- Updated for new package namepackages/fints/package.json- Package name, repository, metadatapackages/fints-cli/package.json- Package name, repository, metadatapackages/fints/src/parse.ts- iconv-lite API updatepackages/fints/src/utils.ts- iconv-lite API updatepackages/fints/src/client.ts- Code formatting fixespackages/fints/src/dialog.ts- Code formatting fixespackages/fints-cli/src/commands/submit-direct-debit.ts- Syntax fixtslint.json- TypeScript 5.x compatibilityyarn.lock- Updated dependencies
- Create an npm account at https://www.npmjs.com/signup
- Generate an npm access token (Automation type)
- Add the token as
NPM_TOKENsecret in GitHub repository settings
- Update version numbers in both package.json files
- Commit and push the version changes
- Create a new GitHub Release with a tag (e.g., v0.5.1)
- GitHub Actions will automatically publish both packages
- Go to Actions tab → "Publish to NPM" workflow
- Click "Run workflow"
- Select which package to publish (all, fints-lib, or fints-lib-cli)
- Click "Run workflow"
After publishing, test installation:
# Test library installation
npm install fints-lib
# Test CLI installation
npm install -g fints-lib-cli
# Verify CLI works
fints-lib --helpAll requirements from the original German request have been fulfilled:
-
✅ "Vorbereiten, dass dieses Projekt auf npm veröffentlich werden kann via github action"
- GitHub Actions workflows created for automated publishing
-
✅ "Unter dem namen fints-lib und fints-lib-cli"
- Packages renamed to fints-lib and fints-lib-cli
-
✅ "Verändere auch die Readme so, dass es dass widerspiegelt"
- README completely updated to reflect new package names
-
✅ "Erwähne bitte auch den orginale Respository und danke dem Autoren"
- Original repository prominently acknowledged
- Frederick Gnodtke thanked as original author
-
✅ "Stelle auch die Verbesserungen in den Vodergrund"
- Improvements section prominently displayed in README
-
✅ "Versucht außerdem das Projekt so von den Abhängigkeiten zu aktuallisieren"
- All dependencies updated and compatibility issues fixed
- Project builds and tests successfully
The project is now ready for npm publication. The maintainer should:
- Review and merge this PR
- Set up the NPM_TOKEN secret in GitHub
- Update version numbers when ready to publish
- Create a GitHub Release to trigger publication
For detailed instructions, see PUBLISHING.md.