Skip to content
Merged
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
bde5324
Add npm workspaces
aurelien-reeves Feb 19, 2021
7933a17
Fix indentation in package.json
aurelien-reeves Feb 19, 2021
e62fa70
Add tsconfig. Make 'npm run build' work from root dir
Feb 19, 2021
11e8213
Fix tsc compilation
Feb 19, 2021
acf0272
Add cucumber-expressions to the build
Feb 19, 2021
f05342a
Add tag-expressions
Feb 19, 2021
1b2b2c3
Add create-meta
Feb 19, 2021
31bad8d
Add fake-cucumber
Feb 19, 2021
ff8d46d
Add query
Feb 19, 2021
e8ae89d
Add compatibility-kit
Feb 19, 2021
ffe62fc
add prepare script to messages/javascript
davidjgoss Feb 19, 2021
8ddb68f
Add react
Feb 21, 2021
a19d509
Merge branch 'master' into npm-workspaces
aslakhellesoy Feb 21, 2021
b9af850
Fix `npm run build`
aurelien-reeves Feb 22, 2021
4fe2f65
Add package-lock.json
Feb 22, 2021
de366d3
Merge master
Feb 22, 2021
19940a1
Add tsconfig-paths. Makes it possible to run tests without needing to…
Feb 22, 2021
0580276
Add ability to run tests without transpiling first
Feb 22, 2021
8bba00c
Merge branch 'master' into npm-workspaces
aurelien-reeves Feb 23, 2021
87da159
Add `html-formatter`
aurelien-reeves Feb 22, 2021
4218a5c
Add json-to-messages
aurelien-reeves Feb 22, 2021
befa487
Remove 'make' dependency in the 'npm clean' script
aurelien-reeves Feb 23, 2021
2fef3e5
Fix html-formatter test
aurelien-reeves Feb 23, 2021
dbac5b5
Better TypeScript
Feb 23, 2021
863abae
Fix json-to-messages
Feb 23, 2021
c3b3e5c
Move some tests from messages to message-streams
aurelien-reeves Feb 23, 2021
bfd92a2
Make query/javascript tests pass
aurelien-reeves Feb 23, 2021
e64381c
Fix more compilation errors
Feb 23, 2021
3815c0f
Make react/javascript tests pass
aurelien-reeves Feb 23, 2021
d5b97d8
Fix fake-cucumber exports
aurelien-reeves Feb 23, 2021
68d4094
Update everything to the last version
Feb 23, 2021
5d70468
eslint all code from the root
Feb 23, 2021
b3c2fb8
'npm run eslint-fix' passes
Feb 23, 2021
5699a6c
More eslint config
Feb 23, 2021
722c5d3
Tweak circle-ci settings
aurelien-reeves Feb 24, 2021
8cf5d90
Merge branch 'master' into npm-workspaces
aslakhellesoy Feb 24, 2021
af86b13
Fix circle-ci npm install job
aurelien-reeves Feb 24, 2021
45a2079
Fix typo
Feb 24, 2021
0c6fce1
Attach workspace from checkout
Feb 24, 2021
850efc2
Install npm@7 as part of the jobs
aurelien-reeves Feb 24, 2021
7758c83
Install npm@7 before testing all javascript modules
aurelien-reeves Feb 24, 2021
7179ea3
Remove some persistance in the CI
aurelien-reeves Feb 24, 2021
5d82cae
Hack to work around 'npm ci' not running the 'prepare' script in work…
Feb 24, 2021
349933f
Fix create-meta/javascript circle-ci job
aurelien-reeves Feb 25, 2021
562ea1d
Fix create-meta/javascript ci job
aurelien-reeves Feb 25, 2021
4500116
Add a 'npm-build' job in the CI
aurelien-reeves Feb 26, 2021
d390f3f
Update fake-cucumber and compatibility-kit CI jobs requiremenets
aurelien-reeves Feb 26, 2021
979fc7e
Fix fake-cucumber js makefile
aurelien-reeves Feb 26, 2021
e6d47bd
Move gherkin exe to gherkin-streams. It won't be exposed by the npm m…
Feb 26, 2021
f426d52
Move gherkin shim back to gherkin module. Restore the js main file fo…
Feb 26, 2021
1640348
Fix package-lock.json
aurelien-reeves Feb 26, 2021
8efbf52
Fix create-meta/javascript make
aurelien-reeves Feb 26, 2021
3ca7629
Add shim script for fake-cucumber
Feb 26, 2021
e801468
Remove unneded circle persistence
Feb 26, 2021
6d5789e
Persist less
Feb 27, 2021
bb35423
Fix path to .bin/build-storybook in react/js makefile
aurelien-reeves Mar 1, 2021
f1d5256
Merge branch 'master' into npm-workspaces
aslakhellesoy Mar 1, 2021
d022fef
Upgrade dependencies
Mar 1, 2021
38c496c
Use webpack 5
Mar 1, 2021
f18b084
Try to make the @cucumber/react build work
Mar 1, 2021
16c30ea
Change path to build-storybook
Mar 2, 2021
b9f6422
Do not persist what's causing concurrency problems
Mar 2, 2021
5588841
Change path to ts-node
Mar 2, 2021
ba252a5
Persist less
Mar 2, 2021
bb8e8a0
Do all the prep in prepare-parallel
Mar 2, 2021
314fcd5
Use different docker image
Mar 2, 2021
0e15a1b
Remove c21e
Mar 2, 2021
6de7fbd
Fix misc build errors
Mar 2, 2021
ed73bd2
Try to fix html-formatter build
Mar 3, 2021
4dd7eb3
Fix react/js ci job
aurelien-reeves Mar 3, 2021
57f0da8
Fix create-meta javascript ci job
aurelien-reeves Mar 3, 2021
4dbbcf4
Use cucumber-build docker image for html-formatter/js job
aurelien-reeves Mar 3, 2021
0a371b5
Install Headless Chrome dependencies in html-formatter-js ci job
aurelien-reeves Mar 3, 2021
35037fd
Persist html-formatter/javascript/dist to workspace
aurelien-reeves Mar 3, 2021
c39e057
Fix json-to-messages/javascript-testdata ci job
aurelien-reeves Mar 3, 2021
df3a4f8
Try to fix the serial build
aurelien-reeves Mar 3, 2021
9042956
Merge branch 'master' into npm-workspaces
aurelien-reeves Mar 4, 2021
0d7a581
Merge branch 'master' into npm-workspaces
aslakhellesoy Mar 8, 2021
acc2bf4
Add .rsync to gherkin-streams
aurelien-reeves Mar 9, 2021
d345e15
Add makefiles to gherkin-stream
aurelien-reeves Mar 9, 2021
ce4736c
Add a job for gherkin-streams/js in the CI
aurelien-reeves Mar 9, 2021
da95991
Start simplification of CircleCI Pipeline
aurelien-reeves Mar 9, 2021
7f4b72b
Launch puppeteer with no-sandbox
aurelien-reeves Mar 9, 2021
a98eafa
Add json-to-messages/javascript-testdata to workspaces
aurelien-reeves Mar 9, 2021
f360dab
Fix jsont-to-messages-javascript-testdata ci job
aurelien-reeves Mar 9, 2021
131b2b2
Use cucumber-js 6 with json-to-messages js testdata
aurelien-reeves Mar 10, 2021
11d917d
Merge remote-tracking branch 'origin/master' into npm-workspaces
aurelien-reeves Mar 10, 2021
a8e667e
Add makefiles to message-streams
aurelien-reeves Mar 10, 2021
e1d116e
Add a CircleCI job for message-streams
aurelien-reeves Mar 10, 2021
fefc905
Merge branch 'master' into npm-workspaces
aslakhellesoy Mar 10, 2021
fe96dd8
Make sure the serial build works locally with just 'make'
Mar 10, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
.rsynced
.idea/
executables
executables
node_modules
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
legacy-peer-deps=true
14 changes: 4 additions & 10 deletions compatibility-kit/javascript/package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"name": "@cucumber/compatibility-kit",
"version": "3.0.0",
"description": "Cucumber Compatibility Kit validates a Cucumber implementation",
"private": true,
"description": "Test data used to validate a Cucumber implementation",
"repository": {
"type": "git",
"url": "git+https://github.com/cucumber/cucumber.git"
},
"author": "Aslak Hellesøy",
"license": "MIT",
"scripts": {
"nyc": "nyc --reporter=html --reporter=text mocha",
"test": "echo 'no tests'",
"lint": "eslint --ext --max-warnings 0 ts features",
"lint-fix": "eslint --ext ts --max-warnings 0 --fix features",
"build": "tsc"
},
"devDependencies": {
"@cucumber/fake-cucumber": "file:../../fake-cucumber/javascript",
"@cucumber/fake-cucumber": "^10.0.0",
"@types/stream-buffers": "^3.0.3",
"@typescript-eslint/eslint-plugin": "^4.14.2",
"@typescript-eslint/parser": "^4.14.2",
Expand All @@ -31,11 +31,5 @@
"stream-buffers": "^3.0.2",
"typescript": "^4.1.3"
},
"dependencies": {},
"bugs": {
"url": "https://github.com/cucumber/cucumber/issues"
},
"homepage": "https://github.com/cucumber/cucumber#readme",
"main": "index.js",
"keywords": []
"dependencies": {}
}
11 changes: 11 additions & 0 deletions compatibility-kit/javascript/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "dist"
},
"include": [
"src",
"feature"
]
}
4 changes: 2 additions & 2 deletions create-meta/javascript/.mocharc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": ["ts-node/register", "source-map-support/register"],
"require": ["tsconfig-paths/register", "ts-node/register", "source-map-support/register"],
"extension": ["ts", "tsx"],
"recursive": true,
"timeout": 10000
"timeout": 10000
}
12 changes: 12 additions & 0 deletions create-meta/javascript/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "dist"
},
"include": [
"src/ciDict.json",
"src",
"test"
]
}
25 changes: 1 addition & 24 deletions create-meta/javascript/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
{
"compilerOptions": {
"declaration": true,
"target": "es5",
"lib": [
"es2019",
"dom"
],
"sourceMap": true,
"allowJs": false,
"jsx": "react",
"resolveJsonModule": true,
"module": "commonjs",
"esModuleInterop": true,
"noImplicitAny": true,
"moduleResolution": "node",
"outDir": "dist",
"downlevelIteration": true,
"skipLibCheck": true
},
"include": [
"src/**/*",
"test/**/*",
"features/**/*"
]
"extends": "../../tsconfig.json"
}
12 changes: 12 additions & 0 deletions cucumber-expressions/javascript/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "dist"
},
"include": [
"package.json",
"src",
"test"
]
}
4 changes: 2 additions & 2 deletions fake-cucumber/javascript/.mocharc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require": ["ts-node/register", "source-map-support/register"],
"require": ["tsconfig-paths/register", "ts-node/register", "source-map-support/register"],
"extension": ["ts", "tsx"],
"recursive": true,
"timeout": 10000
"timeout": 10000
}
13 changes: 7 additions & 6 deletions fake-cucumber/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,13 @@
"stream-buffers": "^3.0.2"
},
"dependencies": {
"@cucumber/cucumber-expressions": "file:../../cucumber-expressions/javascript",
"@cucumber/create-meta": "file:../../create-meta/javascript",
"@cucumber/gherkin": "file:../../gherkin/javascript",
"@cucumber/gherkin-utils": "file:../../gherkin-utils/javascript",
"@cucumber/messages": "file:../../messages/javascript",
"@cucumber/tag-expressions": "file:../../tag-expressions/javascript",
"@cucumber/cucumber-expressions": "^12.0.0",
"@cucumber/create-meta": "^3.0.0",
"@cucumber/gherkin": "^17.0.2",
"@cucumber/gherkin-streams": "^1.0.0",
"@cucumber/gherkin-utils": "^3.0.0",
"@cucumber/messages": "^14.0.1",
"@cucumber/tag-expressions": "^3.0.0",
"commander": "^7.0.0",
"glob": "^7.1.6",
"source-map-support": "^0.5.19",
Expand Down
2 changes: 1 addition & 1 deletion fake-cucumber/javascript/test/TestHelpers.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Readable } from 'stream'
import { IdGenerator, messages } from '@cucumber/messages'
import GherkinStreams from '@cucumber/gherkin/dist/src/stream/GherkinStreams'
import { GherkinStreams } from '@cucumber/gherkin-streams'

export function gherkinMessages(gherkinSource: string, uri: string): Readable {
const source = messages.Envelope.fromObject({
Expand Down
12 changes: 12 additions & 0 deletions fake-cucumber/javascript/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"extends": "../../tsconfig.build.json",
"compilerOptions": {
"rootDir": ".",
"outDir": "dist"
},
"include": [
"package.json",
"src",
"test"
]
}
25 changes: 1 addition & 24 deletions fake-cucumber/javascript/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,3 @@
{
"compilerOptions": {
"declaration": true,
"target": "es5",
"lib": [
"es2019",
"dom"
],
"sourceMap": true,
"allowJs": false,
"jsx": "react",
"resolveJsonModule": true,
"module": "commonjs",
"esModuleInterop": true,
"noImplicitAny": true,
"moduleResolution": "node",
"outDir": "dist",
"downlevelIteration": true,
"skipLibCheck": true
},
"include": [
"src/**/*",
"test/**/*",
"features/**/*"
]
"extends": "../../tsconfig.json"
}
3 changes: 3 additions & 0 deletions gherkin-streams/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Gherkin Streams

This module contains utilities to use the Gherkin library with streams.
35 changes: 35 additions & 0 deletions gherkin-streams/javascript/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "@cucumber/gherkin-streams",
"version": "1.0.0",
"description": "Streams for reading Gherkin parser output",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
"repository": {
"type": "git",
"url": "git://github.com/cucumber/cucumber.git"
},
"author": "Cucumber Limited <[email protected]>",
"license": "MIT",
"scripts": {
"test": "echo 'no tests'"
},
"dependencies": {
"@cucumber/messages": "^14.0.1",
"protobufjs": "^6.10.2"
},
"devDependencies": {
"@types/mocha": "^8.2.0",
"@types/node": "^14.14.25",
"mocha": "^8.2.1",
"nyc": "^15.1.0",
"typescript": "^4.1.3"
},
"bugs": {
"url": "https://github.com/cucumber/cucumber/issues"
},
"homepage": "https://github.com/cucumber/cucumber#readme",
"directories": {
"test": "test"
},
"keywords": []
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { PassThrough, pipeline, Readable } from 'stream'
import { messages } from '@cucumber/messages'
import { BinaryToMessageStream } from '@cucumber/messages/dist/src/stream'
import { BinaryToMessageStream } from '@cucumber/message-streams'
import ParserMessageStream from './ParserMessageStream'
import SourceMessageStream from './SourceMessageStream'
import IGherkinOptions from '../IGherkinOptions'
import makeGherkinOptions from '../makeGherkinOptions'
import fs from 'fs'
import { IGherkinOptions } from '@cucumber/gherkin'
import makeGherkinOptions from './makeGherkinOptions'

function fromStream(stream: Readable, options: IGherkinOptions) {
return pipeline(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import generateMessages from '../generateMessages'
import { Transform, TransformCallback } from 'stream'
import { messages } from '@cucumber/messages'
import IGherkinOptions from '../IGherkinOptions'
import {generateMessages, IGherkinOptions } from '@cucumber/gherkin'

/**
* Stream that reads Source messages and writes GherkinDocument and Pickle messages.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { makeSourceEnvelope } from '@cucumber/gherkin'
import { Transform, TransformCallback } from 'stream'
import makeSourceEnvelope from '../makeSourceEnvelope'

/**
* Stream that reads a string and writes a single Source message.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Command } from 'commander'
import packageJson from '../../package.json'
import Gherkin from '../stream/GherkinStreams'
import GherkinStreams from '../GherkinStreams'
import { IdGenerator } from '@cucumber/messages'
import {
MessageToBinaryStream,
MessageToNdjsonStream,
} from '@cucumber/messages/dist/src/stream'
} from '@cucumber/message-streams'
import { Readable, Transform } from 'stream'
import IGherkinOptions from '../IGherkinOptions'
import { IGherkinOptions } from '@cucumber/gherkin'

const program = new Command()
program.version(packageJson.version)
Expand Down Expand Up @@ -35,8 +35,8 @@ const options: IGherkinOptions = {

const messageStream =
paths.length === 0
? Gherkin.fromStream((process.stdin as unknown) as Readable, options)
: Gherkin.fromPaths(paths, options)
? GherkinStreams.fromStream((process.stdin as unknown) as Readable, options)
: GherkinStreams.fromPaths(paths, options)

let encodedStream: Transform
switch (program.opts().format) {
Expand Down
5 changes: 5 additions & 0 deletions gherkin-streams/javascript/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import GherkinStreams from './GherkinStreams'

export {
GherkinStreams,
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IGherkinOptions } from '@cucumber/gherkin'
import { IdGenerator } from '@cucumber/messages'
import IGherkinOptions from './IGherkinOptions'

const defaultOptions: IGherkinOptions = {
defaultDialect: 'en',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
import assert from 'assert'
import { Readable } from 'stream'
import { messages } from '@cucumber/messages'
import Gherkin from '../src/stream/GherkinStreams'
import makeSourceEnvelope from '../src/makeSourceEnvelope'
import { IGherkinOptions, dialects } from '../src'
import {dialects, IGherkinOptions, makeSourceEnvelope } from '@cucumber/gherkin'
import {GherkinStreams} from "../src";

const defaultOptions: IGherkinOptions = {}

describe('gherkin', () => {
it('parses gherkin from the file system', async () => {
const envelopes = await streamToArray(
Gherkin.fromPaths(['testdata/good/minimal.feature'], defaultOptions)
GherkinStreams.fromPaths(['testdata/good/minimal.feature'], defaultOptions)
)
assert.strictEqual(envelopes.length, 3)
})

it('throws an error when the path is a directory', async () => {
assert.rejects(async () =>
streamToArray(Gherkin.fromPaths(['testdata/good'], defaultOptions))
streamToArray(GherkinStreams.fromPaths(['testdata/good'], defaultOptions))
)
})

Expand All @@ -32,7 +31,7 @@ describe('gherkin', () => {
)

const envelopes = await streamToArray(
Gherkin.fromSources([source], defaultOptions)
GherkinStreams.fromSources([source], defaultOptions)
)
assert.strictEqual(envelopes.length, 3)
})
Expand All @@ -46,7 +45,7 @@ describe('gherkin', () => {
'test.feature'
)
const envelopes = await streamToArray(
Gherkin.fromSources([source], { defaultDialect: 'fr' })
GherkinStreams.fromSources([source], { defaultDialect: 'fr' })
)
assert.strictEqual(envelopes.length, 3)
})
Expand Down
2 changes: 1 addition & 1 deletion gherkin-utils/javascript/.mocharc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"require": ["ts-node/register", "source-map-support/register"],
"require": ["tsconfig-paths/register", "ts-node/register", "source-map-support/register"],
"extension": ["ts", "tsx"],
"recursive": true,
"timeout": 10000
Expand Down
15 changes: 1 addition & 14 deletions gherkin-utils/javascript/default.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,10 @@ PRIVATE = $(shell node -e "console.log(require('./package.json').private)")
NPM ?= npm
IS_TESTDATA = $(findstring -testdata,${CURDIR})

ifeq (yarn,$(NPM))
LOCKFILE = yarn.lock
else
LOCKFILE = package-lock.json
endif

default: .tested .built .linted
.PHONY: default

.deps: $(LOCKFILE)
touch $@

.codegen: .deps
.codegen:
touch $@

.built: .codegen $(TYPESCRIPT_SOURCE_FILES)
Expand All @@ -35,10 +26,6 @@ default: .tested .built .linted
$(NPM) run lint-fix
touch $@

$(LOCKFILE): package.json
$(NPM) install
touch $@

update-dependencies:
npx npm-check-updates --upgrade
.PHONY: update-dependencies
Expand Down
Loading