Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add missing .js extensions and update version #51

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: NPM Package to Github registry

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: npm run build
- run: npm test

publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- run: npm ci
- run: |
npm config set '//registry.npmjs.org/:_authToken' "${{secrets.NPM_AUTH_TOKEN}}"
npm publish --access public --tag ${{ github.event.release.tag_name }} --tag latest
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
NPM_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_AUTH_TOKEN}}
2 changes: 1 addition & 1 deletion lib/format-hex.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const HexFormatter: Format;
import { Format } from './cipher-core';
import { Format } from './cipher-core.js';
2 changes: 1 addition & 1 deletion lib/pad-ansix923.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* ANSI X.923 padding strategy.
*/
export const AnsiX923: Padding;
import { Padding } from './cipher-core';
import { Padding } from './cipher-core.js';
2 changes: 1 addition & 1 deletion lib/pad-iso10126.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* ISO 10126 padding strategy.
*/
export const Iso10126: Padding;
import { Padding } from './cipher-core';
import { Padding } from './cipher-core.js';
2 changes: 1 addition & 1 deletion lib/pad-iso97971.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* ISO/IEC 9797-1 Padding Method 2.
*/
export const Iso97971: Padding;
import { Padding } from './cipher-core';
import { Padding } from './cipher-core.js';
2 changes: 1 addition & 1 deletion lib/pad-nopadding.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* A noop padding strategy.
*/
export const NoPadding: Padding;
import { Padding } from './cipher-core';
import { Padding } from './cipher-core.js';
2 changes: 1 addition & 1 deletion lib/pad-zeropadding.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
* Zero padding strategy.
*/
export const ZeroPadding: Padding;
import { Padding } from './cipher-core';
import { Padding } from './cipher-core.js';
7 changes: 4 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "crypto-es",
"version": "2.1.0",
"name": "@highcanfly/crypto-es",
"version": "2.1.1",
"description": "A cryptography algorithms library compatible with ES6 and TypeScript",
"keywords": [
"typescript",
Expand Down Expand Up @@ -43,19 +43,20 @@
"lib"
],
"scripts": {
"build": "exit 0",
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
"debug": "node --experimental-modules __tests__/debug.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/entronad/crypto-es.git"
"url": "git+https://github.com/highcanfly-club/crypto-es.git"
},
"author": "LIN Chen",
"license": "MIT",
"bugs": {
"url": "https://github.com/entronad/crypto-es/issues"
"url": "https://github.com/highcanfly-club/crypto-es/issues"
},
"homepage": "https://github.com/entronad/crypto-es#readme",
"homepage": "https://github.com/highcanfly-club/crypto-es#readme",
"devDependencies": {
"@types/jest": "^29.5.2",
"jest": "29.5.0",
Expand All @@ -65,5 +66,9 @@
"jest": {
"testRegex": "(/__tests__/.*\\.test\\.ts)$",
"preset": "ts-jest/presets/default-esm"
},
"publishConfig": {
"access": "public",
"tag": "latest"
}
}