From 2551ba0faac51f362d39989037014822c9a6f095 Mon Sep 17 00:00:00 2001 From: Markus Tacker Date: Fri, 9 Aug 2024 15:01:27 +0200 Subject: [PATCH] fix: update dependencies --- examples/mars-rover/steps.ts | 4 +- index.ts | 2 +- package-lock.json | 95 ++++++++++++++-------- package.json | 6 +- reporter/markdownReporter.ts | 2 +- runner/UnreplacedPlaceholdersError.spec.ts | 8 +- runner/UnreplacedPlaceholdersError.ts | 2 +- runner/formatTypeBoxErrors.spec.ts | 4 +- runner/matchGroups.ts | 2 +- runner/parseFeaturesInFolder.ts | 6 +- runner/regExpMatchedStep.ts | 2 +- runner/replaceFromExamples.ts | 2 +- runner/runSuite.spec.ts | 4 +- runner/runSuite.ts | 6 +- runner/suiteWalker.spec.ts | 6 +- runner/suiteWalker.ts | 10 +-- runner/validate.spec.ts | 4 +- 17 files changed, 98 insertions(+), 67 deletions(-) diff --git a/examples/mars-rover/steps.ts b/examples/mars-rover/steps.ts index 4770b8f8..26c8d461 100644 --- a/examples/mars-rover/steps.ts +++ b/examples/mars-rover/steps.ts @@ -1,9 +1,9 @@ import { Type } from '@sinclair/typebox' import assert from 'assert/strict' +import { backOff } from 'exponential-backoff' import { regExpMatchedStep } from '../../runner/regExpMatchedStep.js' -import { Direction, rover } from './rover.js' import type { StepRunner } from '../../runner/runSuite.js' -import { backOff } from 'exponential-backoff' +import { Direction, rover } from './rover.js' export type RoverContext = { rover?: ReturnType diff --git a/index.ts b/index.ts index 949d54fa..26df66e7 100644 --- a/index.ts +++ b/index.ts @@ -6,7 +6,7 @@ export * from './reporter/markdownReporter.js' export * from './runner/codeBlockOrThrow.js' export * from './runner/logger.js' export * from './runner/matchGroups.js' +export * from './runner/regExpMatchedStep.js' export * from './runner/runFolder.js' export * from './runner/runSuite.js' -export * from './runner/regExpMatchedStep.js' export * from './runner/UnreplacedPlaceholdersError.js' diff --git a/package-lock.json b/package-lock.json index d6be1489..32e029c6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,9 +10,9 @@ "license": "BSD-3-Clause", "devDependencies": { "@bifravst/eslint-config-typescript": "6.1.13", - "@bifravst/prettier-config": "1.0.4", + "@bifravst/prettier-config": "1.1.0", "@commitlint/config-conventional": "19.2.2", - "@types/node": "20.14.14", + "@types/node": "22.1.0", "@types/toposort": "2.0.7", "check-node-version": "4.2.1", "commitlint": "19.4.0", @@ -27,7 +27,7 @@ "npm": ">=9.0.0" }, "peerDependencies": { - "@sinclair/typebox": "^0.33.1", + "@sinclair/typebox": "^0.33.2", "chalk": "^5.3.0", "jsonata": "^2.0.5", "toposort": "^2.0.2", @@ -244,13 +244,14 @@ } }, "node_modules/@bifravst/prettier-config": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@bifravst/prettier-config/-/prettier-config-1.0.4.tgz", - "integrity": "sha512-FDfh7f38AjG3LFZcf7mioFgvJhvn36CmhM57i3RpreYJQ+b7McBtB9JlEC9ag32+tOzfOVGTLhfwGdXwW2csMQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@bifravst/prettier-config/-/prettier-config-1.1.0.tgz", + "integrity": "sha512-G1McYqZ77adkhaMP4Tavtmqn24tFL3FoPzRZs+h+CogzxocQq1z/5N05BqzfH9nyAmLQCU91vo8zMChiSdQfDA==", "dev": true, "license": "BSD-3-Clause", "dependencies": { - "prettier": "3.3.3" + "prettier": "3.3.3", + "prettier-plugin-organize-imports": "4.0.0" }, "engines": { "node": ">=20", @@ -1149,9 +1150,9 @@ } }, "node_modules/@sinclair/typebox": { - "version": "0.33.1", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.33.1.tgz", - "integrity": "sha512-Ph9TbUwyKZFqKpR2oG+WX+yC5R0Il9IwmzsBFOmEGsbkOayNfkJu2M0O15yL5rsl2UjPvrQa36ukjejqwTvhvQ==", + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.33.2.tgz", + "integrity": "sha512-UzSrE5Ry+YGaTdhgvMGtbRD08zvSpl7l8QstY6XIktcWUGaNJE/AdmAGdewNCa8D5WpSBXFnVqjJz3DhvhbdHg==", "license": "MIT", "peer": true }, @@ -1171,13 +1172,13 @@ "dev": true }, "node_modules/@types/node": { - "version": "20.14.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.14.tgz", - "integrity": "sha512-d64f00982fS9YoOgJkAMolK7MN8Iq3TDdVjchbYHdEmjth/DHowx82GnoA+tVUAN+7vxfYUgAzi+JXbKNd2SDQ==", + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz", + "integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==", "dev": true, "license": "MIT", "dependencies": { - "undici-types": "~5.26.4" + "undici-types": "~6.13.0" } }, "node_modules/@types/normalize-package-data": { @@ -4671,6 +4672,27 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "node_modules/prettier-plugin-organize-imports": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.0.0.tgz", + "integrity": "sha512-vnKSdgv9aOlqKeEFGhf9SCBsTyzDSyScy1k7E0R1Uo4L0cTcOV7c1XQaT7jfXIOc/p08WLBfN2QUQA9zDSZMxA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@vue/language-plugin-pug": "^2.0.24", + "prettier": ">=2.0", + "typescript": ">=2.9", + "vue-tsc": "^2.0.24" + }, + "peerDependenciesMeta": { + "@vue/language-plugin-pug": { + "optional": true + }, + "vue-tsc": { + "optional": true + } + } + }, "node_modules/punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -5571,10 +5593,11 @@ } }, "node_modules/undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", - "dev": true + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.13.0.tgz", + "integrity": "sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==", + "dev": true, + "license": "MIT" }, "node_modules/unicorn-magic": { "version": "0.1.0", @@ -6004,12 +6027,13 @@ } }, "@bifravst/prettier-config": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@bifravst/prettier-config/-/prettier-config-1.0.4.tgz", - "integrity": "sha512-FDfh7f38AjG3LFZcf7mioFgvJhvn36CmhM57i3RpreYJQ+b7McBtB9JlEC9ag32+tOzfOVGTLhfwGdXwW2csMQ==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@bifravst/prettier-config/-/prettier-config-1.1.0.tgz", + "integrity": "sha512-G1McYqZ77adkhaMP4Tavtmqn24tFL3FoPzRZs+h+CogzxocQq1z/5N05BqzfH9nyAmLQCU91vo8zMChiSdQfDA==", "dev": true, "requires": { - "prettier": "3.3.3" + "prettier": "3.3.3", + "prettier-plugin-organize-imports": "4.0.0" } }, "@commitlint/cli": { @@ -6527,9 +6551,9 @@ } }, "@sinclair/typebox": { - "version": "0.33.1", - "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.33.1.tgz", - "integrity": "sha512-Ph9TbUwyKZFqKpR2oG+WX+yC5R0Il9IwmzsBFOmEGsbkOayNfkJu2M0O15yL5rsl2UjPvrQa36ukjejqwTvhvQ==", + "version": "0.33.2", + "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.33.2.tgz", + "integrity": "sha512-UzSrE5Ry+YGaTdhgvMGtbRD08zvSpl7l8QstY6XIktcWUGaNJE/AdmAGdewNCa8D5WpSBXFnVqjJz3DhvhbdHg==", "peer": true }, "@types/conventional-commits-parser": { @@ -6548,12 +6572,12 @@ "dev": true }, "@types/node": { - "version": "20.14.14", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.14.14.tgz", - "integrity": "sha512-d64f00982fS9YoOgJkAMolK7MN8Iq3TDdVjchbYHdEmjth/DHowx82GnoA+tVUAN+7vxfYUgAzi+JXbKNd2SDQ==", + "version": "22.1.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.1.0.tgz", + "integrity": "sha512-AOmuRF0R2/5j1knA3c6G3HOk523Ga+l+ZXltX8SF1+5oqcXijjfTd8fY3XRZqSihEu9XhtQnKYLmkFaoxgsJHw==", "dev": true, "requires": { - "undici-types": "~5.26.4" + "undici-types": "~6.13.0" } }, "@types/normalize-package-data": { @@ -8968,6 +8992,13 @@ "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", "dev": true }, + "prettier-plugin-organize-imports": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/prettier-plugin-organize-imports/-/prettier-plugin-organize-imports-4.0.0.tgz", + "integrity": "sha512-vnKSdgv9aOlqKeEFGhf9SCBsTyzDSyScy1k7E0R1Uo4L0cTcOV7c1XQaT7jfXIOc/p08WLBfN2QUQA9zDSZMxA==", + "dev": true, + "requires": {} + }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", @@ -9570,9 +9601,9 @@ } }, "undici-types": { - "version": "5.26.5", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", - "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.13.0.tgz", + "integrity": "sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==", "dev": true }, "unicorn-magic": { diff --git a/package.json b/package.json index 9a83f4b6..60eae657 100644 --- a/package.json +++ b/package.json @@ -30,9 +30,9 @@ }, "devDependencies": { "@bifravst/eslint-config-typescript": "6.1.13", - "@bifravst/prettier-config": "1.0.4", + "@bifravst/prettier-config": "1.1.0", "@commitlint/config-conventional": "19.2.2", - "@types/node": "20.14.14", + "@types/node": "22.1.0", "@types/toposort": "2.0.7", "check-node-version": "4.2.1", "commitlint": "19.4.0", @@ -92,7 +92,7 @@ "README.md" ], "peerDependencies": { - "@sinclair/typebox": "^0.33.1", + "@sinclair/typebox": "^0.33.2", "chalk": "^5.3.0", "jsonata": "^2.0.5", "toposort": "^2.0.2", diff --git a/reporter/markdownReporter.ts b/reporter/markdownReporter.ts index 3fbc21eb..97d77c77 100644 --- a/reporter/markdownReporter.ts +++ b/reporter/markdownReporter.ts @@ -8,9 +8,9 @@ import type { StepResult, SuiteResult, } from '../runner/runSuite.js' +import type { ScenarioWithExamples } from '../runner/suiteWalker.js' import { inputTable } from './markdown/inputTable.js' import { logEntry } from './markdown/logEntry.js' -import type { ScenarioWithExamples } from '../runner/suiteWalker.js' export const markdownReporter = async (result: SuiteResult): Promise => prettier.format( diff --git a/runner/UnreplacedPlaceholdersError.spec.ts b/runner/UnreplacedPlaceholdersError.spec.ts index 224f5d8d..e1324130 100644 --- a/runner/UnreplacedPlaceholdersError.spec.ts +++ b/runner/UnreplacedPlaceholdersError.spec.ts @@ -1,10 +1,10 @@ -import { describe, it } from 'node:test' -import { UnreplacedPlaceholdersError } from './UnreplacedPlaceholdersError.js' +import assert from 'node:assert' +import os from 'node:os' import path from 'node:path' +import { describe, it } from 'node:test' import { StepKeyword } from '../parser/grammar.js' import { Source } from './getUnreplacedPlaceholders.js' -import assert from 'node:assert' -import os from 'node:os' +import { UnreplacedPlaceholdersError } from './UnreplacedPlaceholdersError.js' describe('UnreplacedPlaceholdersError', () => { it('should format the error', () => { diff --git a/runner/UnreplacedPlaceholdersError.ts b/runner/UnreplacedPlaceholdersError.ts index 5528b688..973c5f6f 100644 --- a/runner/UnreplacedPlaceholdersError.ts +++ b/runner/UnreplacedPlaceholdersError.ts @@ -1,5 +1,5 @@ -import path from 'node:path' import os from 'node:os' +import path from 'node:path' import type { Step } from '../parser/grammar.js' import type { Unreplaced } from './getUnreplacedPlaceholders.js' diff --git a/runner/formatTypeBoxErrors.spec.ts b/runner/formatTypeBoxErrors.spec.ts index 2cfd5fba..69a10a87 100644 --- a/runner/formatTypeBoxErrors.spec.ts +++ b/runner/formatTypeBoxErrors.spec.ts @@ -1,8 +1,8 @@ -import { describe, it } from 'node:test' +import { Type } from '@sinclair/typebox' import assert from 'node:assert/strict' +import { describe, it } from 'node:test' import { formatTypeBoxErrors } from './formatTypeBoxErrors.js' import { validate } from './validate.js' -import { Type } from '@sinclair/typebox' void describe('formatTypeBoxErrors()', async () => void it('should format TypeBox errors', () => { diff --git a/runner/matchGroups.ts b/runner/matchGroups.ts index f941bf99..8705b3f5 100644 --- a/runner/matchGroups.ts +++ b/runner/matchGroups.ts @@ -1,6 +1,6 @@ import { type Static, type TObject } from '@sinclair/typebox' -import { validate } from './validate.js' import { formatTypeBoxErrors } from './formatTypeBoxErrors.js' +import { validate } from './validate.js' export class MatchError extends Error { constructor(message: string) { diff --git a/runner/parseFeaturesInFolder.ts b/runner/parseFeaturesInFolder.ts index 87b5bac0..89dedefd 100644 --- a/runner/parseFeaturesInFolder.ts +++ b/runner/parseFeaturesInFolder.ts @@ -1,10 +1,10 @@ +import { readdir, stat } from 'fs/promises' import { readFile } from 'node:fs/promises' import { parse } from 'node:path' +import path from 'path' +import { feature } from '../parser/feature.js' import type { Feature } from '../parser/grammar.js' import { tokenStream } from '../parser/tokenStream.js' -import { feature } from '../parser/feature.js' -import { readdir, stat } from 'fs/promises' -import path from 'path' export type FeatureFile = { file: ReturnType diff --git a/runner/regExpMatchedStep.ts b/runner/regExpMatchedStep.ts index 4153806a..95f13083 100644 --- a/runner/regExpMatchedStep.ts +++ b/runner/regExpMatchedStep.ts @@ -1,6 +1,6 @@ import { type Static, type TObject } from '@sinclair/typebox' -import type { StepRunner, StepRunnerArgs } from './runSuite.js' import { matchGroups } from './matchGroups.js' +import type { StepRunner, StepRunnerArgs } from './runSuite.js' export const regExpMatcher = (matcher: ReturnType) => diff --git a/runner/replaceFromExamples.ts b/runner/replaceFromExamples.ts index 60453f30..80106d8b 100644 --- a/runner/replaceFromExamples.ts +++ b/runner/replaceFromExamples.ts @@ -1,5 +1,5 @@ -import { type Step } from '../parser/grammar.js' import jsonata from 'jsonata' +import { type Step } from '../parser/grammar.js' export const replaceFromExamples = async ( step: Step, diff --git a/runner/runSuite.spec.ts b/runner/runSuite.spec.ts index dafe88d2..ed34ac66 100644 --- a/runner/runSuite.spec.ts +++ b/runner/runSuite.spec.ts @@ -1,3 +1,4 @@ +import { Type } from '@sinclair/typebox' import assert from 'assert/strict' import { randomUUID } from 'node:crypto' import { describe, it } from 'node:test' @@ -7,6 +8,7 @@ import { loadFeatureFile, parseFeaturesInFolder, } from './parseFeaturesInFolder.js' +import { regExpMatchedStep } from './regExpMatchedStep.js' import { runSuite, type FeatureResult, @@ -14,8 +16,6 @@ import { type StepResult, type StepRunner, } from './runSuite.js' -import { regExpMatchedStep } from './regExpMatchedStep.js' -import { Type } from '@sinclair/typebox' describe('runSuite()', () => { it('should run a simple test suite', async () => { diff --git a/runner/runSuite.ts b/runner/runSuite.ts index 2478b5f2..b040df39 100644 --- a/runner/runSuite.ts +++ b/runner/runSuite.ts @@ -1,4 +1,6 @@ +import os from 'node:os' import path, { type ParsedPath } from 'path' +import type { Step } from '../parser/grammar.js' import { logger, type LogEntry, @@ -8,11 +10,9 @@ import { import { type FeatureFile } from './parseFeaturesInFolder.js' import { suiteWalker, - type ScenarioWithExamples, type FeatureVariant, + type ScenarioWithExamples, } from './suiteWalker.js' -import os from 'node:os' -import type { Step } from '../parser/grammar.js' export type StepRunnerArgs> = { feature: FeatureVariant diff --git a/runner/suiteWalker.spec.ts b/runner/suiteWalker.spec.ts index 7d001e2a..d4eab49a 100644 --- a/runner/suiteWalker.spec.ts +++ b/runner/suiteWalker.spec.ts @@ -1,8 +1,8 @@ -import { describe, it, mock } from 'node:test' -import { suiteWalker } from './suiteWalker.js' +import assert from 'node:assert' import path from 'node:path' +import { describe, it, mock } from 'node:test' import { parseFeaturesInFolder } from './parseFeaturesInFolder.js' -import assert from 'node:assert' +import { suiteWalker } from './suiteWalker.js' describe('suiteWalker()', () => { it('should walk a suite', async () => { diff --git a/runner/suiteWalker.ts b/runner/suiteWalker.ts index 71fd8790..d48b69ee 100644 --- a/runner/suiteWalker.ts +++ b/runner/suiteWalker.ts @@ -2,18 +2,18 @@ import type path from 'node:path' import { Keyword, type Feature, - type Step, type Row, type Scenario, + type Step, } from '../parser/grammar.js' -import { orderFeatures } from './orderFeatures.js' -import type { FeatureFile } from './parseFeaturesInFolder.js' -import { replaceFromExamples } from './replaceFromExamples.js' -import { replaceFromContext } from './replaceFromContext.js' import { Source, getUnreplacedPlaceholders, } from './getUnreplacedPlaceholders.js' +import { orderFeatures } from './orderFeatures.js' +import type { FeatureFile } from './parseFeaturesInFolder.js' +import { replaceFromContext } from './replaceFromContext.js' +import { replaceFromExamples } from './replaceFromExamples.js' import { UnreplacedPlaceholdersError } from './UnreplacedPlaceholdersError.js' type FeatureListenerArgs = { diff --git a/runner/validate.spec.ts b/runner/validate.spec.ts index 849e5f74..d87241a8 100644 --- a/runner/validate.spec.ts +++ b/runner/validate.spec.ts @@ -1,7 +1,7 @@ import { Type } from '@sinclair/typebox' -import { validate } from './validate.js' -import { describe, test as it } from 'node:test' import assert from 'node:assert/strict' +import { describe, test as it } from 'node:test' +import { validate } from './validate.js' void describe('validate', () => { void it('Should check input is valid', async () => {