Skip to content

Commit

Permalink
Merge pull request #38 from merkle-open/chore/update-node-and-depende…
Browse files Browse the repository at this point in the history
…ncies

chore: update node and dependencies
  • Loading branch information
ernscht authored Jan 29, 2024
2 parents cab10f4 + f6c023d commit aef6510
Show file tree
Hide file tree
Showing 13 changed files with 12,329 additions and 23,088 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
extends: [
'@namics/eslint-config/configurations/typescript-node.js',
'@namics/eslint-config/configurations/typescript-node-disable-styles.js',
'@merkle-open/eslint-config/configurations/typescript-node.js',
'@merkle-open/eslint-config/configurations/typescript-node-disable-styles.js',
].map(require.resolve),
rules: {
'no-console': 0,
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
name: Test - ${{ matrix.platform }} - Node v${{ matrix.node-version }}
strategy:
matrix:
node-version: [14.x, 16.x]
node-version: [18.x, 20.x]
platform: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.13.0
20.9.0
2 changes: 1 addition & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = require('@namics/prettier-config');
module.exports = require('@merkle-open/prettier-config');
26 changes: 13 additions & 13 deletions __tests__/exact-dependency-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ describe('exactDependencyVersions', () => {

expect(dependencies.error).toEqual(false);
expect(dependencies.text).toEqual(
logMessages.success.allDependenciesExact('dependencies', fakeValidPackage.name)
logMessages.success.allDependenciesExact('dependencies', fakeValidPackage.name),
);
expect(devDependencies.error).toEqual(false);
expect(devDependencies.text).toEqual(
logMessages.success.allDependenciesExact('devDependencies', fakeValidPackage.name)
logMessages.success.allDependenciesExact('devDependencies', fakeValidPackage.name),
);
});

Expand All @@ -91,19 +91,19 @@ describe('exactDependencyVersions', () => {

expect(dependencies.text).toContain('Not all dependencies in fakeInvalidPackage have been declared by exact');
expect(dependencies.invalidDefinitions[0].text).toEqual(
'[react] Approximate version identifier "^" is not allowed.'
'[react] Approximate version identifier "^" is not allowed.',
);
expect(dependencies.invalidDefinitions[1].text).toEqual(
'[react-dom] Approximate version identifier "~" is not allowed.'
'[react-dom] Approximate version identifier "~" is not allowed.',
);
expect(devDependencies.text).toContain(
'Not all devDependencies in fakeInvalidPackage have been declared by exact'
'Not all devDependencies in fakeInvalidPackage have been declared by exact',
);
expect(devDependencies.invalidDefinitions[0].text).toEqual(
'[typescript] Approximate version identifier "~" is not allowed.'
'[typescript] Approximate version identifier "~" is not allowed.',
);
expect(devDependencies.invalidDefinitions[1].text).toEqual(
'[eslint] Approximate version identifier "^" is not allowed.'
'[eslint] Approximate version identifier "^" is not allowed.',
);
});

Expand All @@ -117,16 +117,16 @@ describe('exactDependencyVersions', () => {
expect(devDependencies.invalidDefinitions).toHaveLength(2);

expect(dependencies.invalidDefinitions[0].text).toEqual(
'[core-js] Wildcard "*" is not allowed as version declaration.'
'[core-js] Wildcard "*" is not allowed as version declaration.',
);
expect(dependencies.invalidDefinitions[1].text).toEqual(
'[react-dom] Approximate version identifier "~" is not allowed.'
'[react-dom] Approximate version identifier "~" is not allowed.',
);
expect(devDependencies.invalidDefinitions[0].text).toEqual(
'[webpack] Approximate version identifier "~" is not allowed.'
'[webpack] Approximate version identifier "~" is not allowed.',
);
expect(devDependencies.invalidDefinitions[1].text).toEqual(
'[forever] Tarball dependencies are not allowed (https://github.com/indexzero/forever/tarball/v0.5.6).'
'[forever] Tarball dependencies are not allowed (https://github.com/indexzero/forever/tarball/v0.5.6).',
);
});

Expand Down Expand Up @@ -155,7 +155,7 @@ describe('exactDependencyVersions', () => {
});
it('should work for mixed multi packages (monorepo)', async () => {
(findPackages as any).mockReturnValue(
Promise.resolve([{ manifest: fakeValidPackage }, { manifest: fakeMixedPackage }])
Promise.resolve([{ manifest: fakeValidPackage }, { manifest: fakeMixedPackage }]),
);
const res = await validateDependenciesVersionsAreExact('./');
expect(res.length).toEqual(2);
Expand All @@ -182,7 +182,7 @@ describe('exactDependencyVersions', () => {
[
logMessages.success.allDependenciesExact('dependencies', fakeValidPackage.name),
logMessages.success.allDependenciesExact('devDependencies', fakeValidPackage.name),
].join('\n')
].join('\n'),
);
});

Expand Down
8 changes: 4 additions & 4 deletions __tests__/version-checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ describe('processVersionArgument', () => {
describe('getVersionCheckers', () => {
it('should return two log-messages (specify yo version and npm works with node).', async () => {
(fetch as any).mockReturnValue(
Promise.resolve(new Response(JSON.stringify([{ version: 'v3.0.0', npm: '3.0.0' }])))
Promise.resolve(new Response(JSON.stringify([{ version: 'v3.0.0', npm: '3.0.0' }]))),
);
(execa as any).mockReturnValue(Promise.resolve({ stdout: '3.0.0' }));
(readFile as any).mockReturnValue(Promise.resolve('3.0.0'));
Expand All @@ -140,7 +140,7 @@ describe('getVersionCheckers', () => {
});
it('should return three log-messages (node version ok, npm works with node, yo version ok)', async () => {
(fetch as any).mockReturnValue(
Promise.resolve(new Response(JSON.stringify([{ version: 'v3.0.0', npm: '3.0.0' }])))
Promise.resolve(new Response(JSON.stringify([{ version: 'v3.0.0', npm: '3.0.0' }]))),
);
(execa as any).mockReturnValue(Promise.resolve({ stdout: '3.0.0' }));
const expectedLogMessages: ILogMessage[] = [
Expand All @@ -153,7 +153,7 @@ describe('getVersionCheckers', () => {
});
it('should return two log-messages (node version ok and npm works with node) without any arguments', async () => {
(fetch as any).mockReturnValue(
Promise.resolve(new Response(JSON.stringify([{ version: 'v3.0.0', npm: '3.0.0' }])))
Promise.resolve(new Response(JSON.stringify([{ version: 'v3.0.0', npm: '3.0.0' }]))),
);
(execa as any).mockReturnValue(Promise.resolve({ stdout: '3.0.0' }));
const expectedLogMessages: ILogMessage[] = [
Expand All @@ -173,7 +173,7 @@ describe('getVersionCheckers', () => {
});
it('should return one log-messages (wrong npm version)', async () => {
(execa as any).mockImplementation((program) =>
program === 'node' ? Promise.resolve({ stdout: '3.0.0' }) : Promise.reject()
program === 'node' ? Promise.resolve({ stdout: '3.0.0' }) : Promise.reject(),
);
const expectedLogMessages: ILogMessage[] = [
{ error: true, text: logMessages.error.readProgramVersionError('npm') },
Expand Down
Loading

0 comments on commit aef6510

Please sign in to comment.