Skip to content

Commit 73066c3

Browse files
authored
Merge pull request #13 from internxt/feat/update-dependencies
[_]: feat/update-dependencies
2 parents 16f4894 + 4614eec commit 73066c3

10 files changed

Lines changed: 2028 additions & 1971 deletions

File tree

.eslintrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ jobs:
1414
packages: write
1515
strategy:
1616
matrix:
17-
node-version: [16.x]
17+
node-version: [22.x]
1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
2020
- name: Use Node.js ${{ matrix.node-version }}
21-
uses: actions/setup-node@v2
21+
uses: actions/setup-node@v4
2222
with:
2323
node-version: ${{ matrix.node-version }}
2424
registry-url: 'https://npm.pkg.github.com'

.github/workflows/publish-npm.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish Package to npmjs
2+
on:
3+
release:
4+
types: [published]
5+
workflow_dispatch:
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
contents: read
11+
id-token: write
12+
packages: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: actions/setup-node@v4
16+
with:
17+
node-version: '22.x'
18+
19+
- run: |
20+
echo "@internxt:registry=https://npm.pkg.github.com/" > .npmrc
21+
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
22+
23+
- run: yarn
24+
- run: yarn run build
25+
26+
# Change the registry to npmjs (to publish)
27+
- run: |
28+
echo "registry=https://registry.npmjs.org/" > .npmrc
29+
echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" >> .npmrc
30+
31+
- run: npm publish --scope=@internxt --access public

.github/workflows/publish.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
name: Publish package in github package registry
22
on:
33
release:
4-
types: [created]
4+
types: [published]
5+
workflow_dispatch:
56
jobs:
67
build:
78
runs-on: ubuntu-latest
89
permissions:
910
contents: read
1011
packages: write
1112
steps:
12-
- uses: actions/checkout@v2
13+
- uses: actions/checkout@v4
1314
# Setup .npmrc file to publish to GitHub Packages
14-
- uses: actions/setup-node@v2
15+
- uses: actions/setup-node@v4
1516
with:
16-
node-version: '16.x'
17+
node-version: '22.x'
1718
registry-url: 'https://npm.pkg.github.com'
1819
- run: yarn
1920
env:

.husky/pre-commit

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
#!/bin/sh
2-
. "$(dirname "$0")/_/husky.sh"
31

42
yarn lint && yarn format && yarn test

eslint.config.mjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import eslintConfigInternxt from '@internxt/eslint-config-internxt';
2+
3+
export default [
4+
{
5+
ignores: ['dist', 'build'],
6+
},
7+
...eslintConfigInternxt,
8+
{
9+
rules: {
10+
"@typescript-eslint/no-explicit-any": "warn",
11+
}
12+
}
13+
];

package.json

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@internxt/lib",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"description": "Common logic shared between different projects of Internxt ",
55
"main": "dist/src/index.js",
66
"types": "dist/src/index.d.ts",
@@ -13,7 +13,7 @@
1313
"build": "tsc",
1414
"lint": "eslint src/**/*.ts",
1515
"format": "prettier src/**/*.ts",
16-
"prepare": "husky install"
16+
"prepare": "husky"
1717
},
1818
"repository": {
1919
"type": "git",
@@ -26,14 +26,15 @@
2626
},
2727
"homepage": "https://github.com/internxt/lib#readme",
2828
"devDependencies": {
29-
"@internxt/eslint-config-internxt": "^1.0.3",
30-
"@internxt/prettier-config": "^1.0.1",
31-
"@types/jest": "^27.0.1",
32-
"eslint": "^7.32.0",
33-
"husky": "^7.0.1",
34-
"jest": "^27.0.6",
35-
"prettier": "^2.3.2",
36-
"ts-jest": "^27.0.5",
37-
"typescript": "^4.3.5"
29+
"@internxt/eslint-config-internxt": "2.0.0",
30+
"@internxt/prettier-config": "1.0.2",
31+
"@types/jest": "30.0.0",
32+
"@types/node": "24.0.4",
33+
"eslint": "9.29.0",
34+
"husky": "9.1.7",
35+
"jest": "30.0.3",
36+
"prettier": "3.6.1",
37+
"ts-jest": "29.4.0",
38+
"typescript": "5.8.3"
3839
}
3940
}

src/items/renameIfNeeded.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@
1313
* if it doesn't exist already.
1414
*/
1515
export default function renameIfNeeded(
16-
items: { name: string; type: string }[],
16+
items: { name: string; type?: string }[],
1717
filename: string,
18-
type: string,
18+
type?: string,
1919
): [boolean, number, string] {
2020
const FILENAME_INCREMENT_REGEX = /( \([0-9]+\))$/i;
2121
const INCREMENT_INDEX_REGEX = /\(([^)]+)\)/;
2222

2323
const cleanFilename = filename.replace(FILENAME_INCREMENT_REGEX, '');
2424

25-
const infoFilenames: { name: string; cleanName: string; type: string; incrementIndex: number }[] = items
25+
const infoFilenames: { name: string; cleanName: string; type?: string; incrementIndex: number }[] = items
2626
.map((item) => {
2727
const cleanName = item.name.replace(FILENAME_INCREMENT_REGEX, '');
2828
const incrementString = item.name.match(FILENAME_INCREMENT_REGEX)?.pop()?.match(INCREMENT_INDEX_REGEX)?.pop();
@@ -35,7 +35,8 @@ export default function renameIfNeeded(
3535
incrementIndex,
3636
};
3737
})
38-
.filter((item) => item.cleanName === cleanFilename && item.type === type)
38+
.filter((item) => item.cleanName.toLowerCase() === cleanFilename.toLowerCase()
39+
&& (item.type?.toLowerCase() ?? '') === (type?.toLowerCase() ?? ''))
3940
.sort((a, b) => b.incrementIndex - a.incrementIndex);
4041

4142
const filenameExists = !!infoFilenames.length;

src/request/extractMessageFromError.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
22
type AxiosError = any;
3-
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
4-
/* eslint-disable-next-line @typescript-eslint/no-unused-vars */
3+
/* eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unused-vars */
54
type AxiosResponse<T> = any;
65
type ErrorMessage = string;
76

0 commit comments

Comments
 (0)