Skip to content

Commit

Permalink
upgrade vendors
Browse files Browse the repository at this point in the history
  • Loading branch information
rvitaliy committed May 10, 2024
1 parent 4a1bc85 commit 3a037b2
Show file tree
Hide file tree
Showing 12 changed files with 1,167 additions and 1,090 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ name: CI
on: [pull_request]

env:
NODE_VERSION: 18.16.1
NODE_VERSION: 20.13.1

jobs:
build:
strategy:
matrix:
node-version: [16.17.0, 18.x, 19.x]
node-version: [18.x, 20.x, 22.x]
platform:
- os: ubuntu-latest
shell: bash
Expand All @@ -21,15 +21,15 @@ jobs:

steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Nodejs ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.yarn/cache
key: ${{ runner.os }}-yarn-${{ hashFiles('${{ github.workspace }}/yarn.lock') }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ on:
- master

env:
NODE_VERSION: 18.16.1
NODE_VERSION: 20.13.1

jobs:
update-coverage:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Nodejs ${{ env.NODE_VERSION }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
environment: publish
steps:
- name: Checkout Repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Use Nodejs
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '18.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- run: yarn install --immutable
Expand Down
46 changes: 23 additions & 23 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "typeorm-fixturio",
"version": "1.0.4",
"version": "1.0.5",
"description": "TypeORM fixtures",
"keywords": [
"typeorm",
Expand Down Expand Up @@ -28,35 +28,35 @@
},
"dependencies": {
"fixturio": "^1.0.2",
"typeorm-extension": "^2.8.1"
"typeorm-extension": "^3.5.1"
},
"peerDependencies": {
"typeorm": "^0.3.11"
"typeorm": "^0.3.20"
},
"devDependencies": {
"@types/jest": "^29.2.5",
"@types/node": "^18.16.1",
"@typescript-eslint/eslint-plugin": "^5.48.0",
"@typescript-eslint/parser": "^5.48.0",
"dts-bundle-generator": "^8.0.1",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.11",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"dts-bundle-generator": "^9.5.1",
"eslint": "^8.31.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jest": "^27.2.2",
"eslint-plugin-prettier": "^4.0.0",
"jest": "^29.3.1",
"mysql2": "^3.4.3",
"prettier": "^2.4.0",
"rimraf": "^5.0.1",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"tsc-alias": "^1.8.6",
"typeorm": "^0.3.17",
"typescript": "^5.1.3"
"eslint-config-airbnb-typescript": "^18.0.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jest": "^28.5.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "^29.7.0",
"mysql2": "^3.9.7",
"prettier": "^3.2.5",
"rimraf": "^5.0.5",
"ts-jest": "^29.1.2",
"ts-node": "^10.9.2",
"tsc-alias": "^1.8.9",
"typeorm": "^0.3.20",
"typescript": "^5.4.5"
},
"engines": {
"node": ">=16.17.0"
"node": ">=18.12.1"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions src/container/TypeOrmContainer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ export class TypeOrmContainer implements ServiceContainerInterface {
}

getService<TInput = unknown, TResult = TInput>(
typeOrToken: InjectDependency<TInput> | string
typeOrToken: InjectDependency<TInput> | string,
): TResult {
const service = this.container[typeOrToken.toString()];

if (service === undefined) {
throw new Error(
`service ${typeOrToken} is not registered is the base container provided by typeorm-fixturio`
`service ${typeOrToken} is not registered is the base container provided by typeorm-fixturio`,
);
}

Expand Down
8 changes: 4 additions & 4 deletions src/container/__tests__/containerImporter.Spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ describe('containerImporter', () => {
const invalidContainerFile = resolve(containersPath, 'invalidContainerProvider.ts');

await expect(containerImporter(invalidContainerFile)).rejects.toThrow(
new ContainerImporterException('Exported file should provide a containerProvider function')
new ContainerImporterException('Exported file should provide a containerProvider function'),
);
});

it('throws a ContainerImporterException when provided container does not implement ServiceContainerInterface', async () => {
const notImplimentedServiceContainerInterfaceFile = resolve(
containersPath,
'notImplementedServiceContainerInterface.ts'
'notImplementedServiceContainerInterface.ts',
);

await expect(containerImporter(notImplimentedServiceContainerInterfaceFile)).rejects.toThrow(
new ContainerImporterException(
'Provided container should implement ServiceContainerInterface'
)
'Provided container should implement ServiceContainerInterface',
),
);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { InjectDependency, ServiceContainerInterface } from 'fixturio';
export async function containerProvider(): Promise<ServiceContainerInterface> {
return {
getService<TInput = unknown, TResult = TInput>(
_typeOrToken: InjectDependency<TInput> | string
_typeOrToken: InjectDependency<TInput> | string,
): TResult {
return <TResult>{};
},
Expand Down
4 changes: 2 additions & 2 deletions src/container/containerImporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ export async function containerImporter(containerFile: string): Promise<ServiceC

if (typeof containerProvider !== 'function') {
throw new ContainerImporterException(
'Exported file should provide a containerProvider function'
'Exported file should provide a containerProvider function',
);
}

const container = await containerProvider();

if (typeof container.getService !== 'function') {
throw new ContainerImporterException(
'Provided container should implement ServiceContainerInterface'
'Provided container should implement ServiceContainerInterface',
);
}

Expand Down
2 changes: 1 addition & 1 deletion src/runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const runner = async ({
const fixtureContainer = new FixtureContainer(
containerFile !== undefined
? await containerImporter(containerFile)
: new TypeOrmContainer(dataSource)
: new TypeOrmContainer(dataSource),
);

const { loadedResults } = await fixtureContainer.installFixtures({
Expand Down
4 changes: 2 additions & 2 deletions src/utils/args/__tests__/argsValidator.Spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ describe('argsValidator', () => {

expect(() => argsValidator(args)).toThrow(ArgsException);
expect(() => argsValidator(args)).toThrow(
'filePatterns is required. Please specify a ts config path `filePatterns=<filePatterns>`'
'filePatterns is required. Please specify a ts config path `filePatterns=<filePatterns>`',
);
});

Expand All @@ -29,7 +29,7 @@ describe('argsValidator', () => {

expect(() => argsValidator(args)).toThrow(ArgsException);
expect(() => argsValidator(args)).toThrow(
'dataSourceFile is required. Please specify a ts config path `dataSourceFile=<dataSourceFile>`'
'dataSourceFile is required. Please specify a ts config path `dataSourceFile=<dataSourceFile>`',
);
});
});
4 changes: 2 additions & 2 deletions src/utils/args/argsValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ export function argsValidator(args: RawOptions): asserts args is Options {

if (filePatterns === undefined) {
throw new ArgsException(
'filePatterns is required. Please specify a ts config path `filePatterns=<filePatterns>`'
'filePatterns is required. Please specify a ts config path `filePatterns=<filePatterns>`',
);
}

if (dataSourceFile === undefined) {
throw new ArgsException(
'dataSourceFile is required. Please specify a ts config path `dataSourceFile=<dataSourceFile>`'
'dataSourceFile is required. Please specify a ts config path `dataSourceFile=<dataSourceFile>`',
);
}
}
Loading

0 comments on commit 3a037b2

Please sign in to comment.