Skip to content

Commit

Permalink
Merge fca6470 into 49a51f9
Browse files Browse the repository at this point in the history
  • Loading branch information
aurelien-reeves committed Dec 6, 2021
2 parents 49a51f9 + fca6470 commit c81e73c
Show file tree
Hide file tree
Showing 7 changed files with 99 additions and 8 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ usage.txt
yarn-error.log
.vscode
.DS_Store
src/version.ts
3 changes: 1 addition & 2 deletions features/step_definitions/cli_steps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import {
valueOrDefault,
} from '../../src/value_checker'
import { World } from '../support/world'

const { version } = require('../../package.json') // eslint-disable-line @typescript-eslint/no-var-requires
import { version } from '../../src/version'

When('my env includes {string}', function (this: World, envString: string) {
this.sharedEnv = this.parseEnvString(envString)
Expand Down
92 changes: 92 additions & 0 deletions package-lock.json

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

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@
"eslint-plugin-standard": "4.1.0",
"express": "4.17.1",
"fs-extra": "10.0.0",
"genversion": "^3.0.2",
"mocha": "9.1.3",
"mustache": "4.2.0",
"nyc": "15.1.0",
Expand All @@ -267,7 +268,7 @@
"typescript": "4.5.2"
},
"scripts": {
"build-local": "tsc --build tsconfig.node.json && shx cp src/importer.js lib/ && shx cp src/wrapper.mjs lib/",
"build-local": "genversion --es6 src/version.ts && tsc --build tsconfig.node.json && shx cp src/importer.js lib/ && shx cp src/wrapper.mjs lib/",
"cck-test": "mocha 'compatibility/**/*_spec.ts'",
"feature-test": "node ./bin/cucumber-js",
"html-formatter": "node ./bin/cucumber-js --profile htmlFormatter",
Expand Down
4 changes: 1 addition & 3 deletions src/cli/argv_parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import path from 'path'
import { dialects } from '@cucumber/gherkin'
import { SnippetInterface } from '../formatter/step_definition_snippet_builder/snippet_syntax'
import Formatters from '../formatter/helpers/formatters'

// Using require instead of import so compiled typescript will have the desired folder structure
const { version } = require('../../package.json') // eslint-disable-line @typescript-eslint/no-var-requires
import { version } from '../version'

export interface IParsedArgvFormatRerunOptions {
separator?: string
Expand Down
3 changes: 1 addition & 2 deletions src/cli/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { ISupportCodeLibrary } from '../support_code_library_builder/types'
import TestCaseHookDefinition from '../models/test_case_hook_definition'
import TestRunHookDefinition from '../models/test_run_hook_definition'
import { builtinParameterTypes } from '../support_code_library_builder'
import { version } from '../version'

export interface IGetExpandedArgvRequest {
argv: string[]
Expand Down Expand Up @@ -114,8 +115,6 @@ export function isJavaScript(filePath: string): boolean {
export async function emitMetaMessage(
eventBroadcaster: EventEmitter
): Promise<void> {
// eslint-disable-next-line @typescript-eslint/no-var-requires
const { version } = require('../../package.json')
eventBroadcaster.emit('envelope', {
meta: createMeta('cucumber-js', version, process.env),
})
Expand Down
1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export {
} from './runtime'
export { default as supportCodeLibraryBuilder } from './support_code_library_builder'
export { default as DataTable } from './models/data_table'
export { version } from './version'

// Formatters
export { default as Formatter, IFormatterOptions } from './formatter'
Expand Down

0 comments on commit c81e73c

Please sign in to comment.