Skip to content

Commit

Permalink
Modernize gauge typescript plugin
Browse files Browse the repository at this point in the history
* Upgrade packages

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Upgrade to latest version of typescript

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Fix compilation errors

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Fix eslint errors

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Formatting changes

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Formatting changes

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Formatting changes

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Fix all linting issues

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Fix all linting issues

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Fix lint more lint issues

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Remove comments

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Use npx for launching ts-node

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Fix typo

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Use default start to reduce line of code

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Add commit hook

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Formatting changes

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Formatting changes

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Add non recursive logic and format

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Make static loader a default class

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Revert spawn sync changes

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Split function to start and stop

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Rename to RunnerServer

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Use client calls to test grpc

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Add husky

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Fix tests

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Update readme

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Update submodule

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Move to latest node version and remove coverage

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Remove codecov

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Format docs

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Make processors singleton

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Remove unused packages

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Remove klawsync

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Load implementations

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Pass static loader in the start method

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Pass default values to start server

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Remove redundant async file check

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Remove bun lock file

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Change urls to getgauge

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Remove deprecated screen shot method

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Remove unused dependency

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Remove custom screenshot grabber tests

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Add functional tests

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

Use workspace and add functional tests

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

Remove java file

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

Add common build tasks

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

Add implementation

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Update build file

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Use the correct working directory

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Use node 20 for building artifacts

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Move package task to root

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Use latest versions of checkout and setup node

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Run npm ci before packaging

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Move linting and formatting to root

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Move formatting and building to root task

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Run biome using npx

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Add a gitattributes file for cross platform line ending

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Set up default line feed

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Add formatting check before running unit tests

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Fix artifact folder path

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Run build for gauge-ts

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Remove experimental options as it create issues on windows

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Move start to runner server to avoid circular dependency

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Remove Gauge runtime

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Fix file copying for windows

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Fix fomatting issue

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Change urls to point to getgauge

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Modify release tasks

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

* Remove old delivery bot actions

This service does not have a website and is unmaintained

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>

---------

Signed-off-by: Zabil Cheriya Maliackal <zabilcm@gmail.com>
  • Loading branch information
zabil authored Jun 11, 2024
1 parent 1478d40 commit 9f417b9
Show file tree
Hide file tree
Showing 191 changed files with 13,212 additions and 13,857 deletions.
15 changes: 0 additions & 15 deletions .eslintignore

This file was deleted.

36 changes: 0 additions & 36 deletions .eslintrc.js

This file was deleted.

82 changes: 51 additions & 31 deletions .github/workflows/nodejs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,87 +3,107 @@ name: test
on: [push, pull_request]

jobs:
check:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"

- name: Install dependencies
run: |
npm ci
- name: Check formatting and linting
run: |
npm run check
test:
needs: check
strategy:
matrix:
node-version: [12.x,13.x, 14.x]
node-version: [20.x]
os: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: npm install and test
- name: Install dependencies
run: |
npm install
npm run test:coverage
npm ci
env:
CI: true

- name: Update coverage
- name: Run gauge ts unit tests
run: |
npm run codecov -- -t ${{ secrets.CODECOV_TOKEN }}
npm test -w gauge-ts
env:
CI: true

build-artifacts:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: npm install
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: "20.x"

- name: Create artifact
run: |
./build.sh package
npm pack
mv ./gauge-ts-*.tgz ./artifacts
npm ci
npm run package -w gauge-ts
npm pack -w gauge-ts
mv ./gauge-ts-*.tgz ./gauge-ts/artifacts
- name: Upload artifacts for local
uses: actions/upload-artifact@v1
with:
name: gauge-ts
path: ./artifacts
path: ./gauge-ts/artifacts

sample-project:
e2e-test:
needs: build-artifacts
strategy:
matrix:
node-version: [12.x, 13.x, 14.x]
node-version: [20.x]
os: [macOS-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}

steps:
- uses: BugDiver/setup-gauge@master
with:
gauge-version: master

- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: npm dependencies
run: |
npm ci
npm run build
- uses: actions/download-artifact@v1
with:
name: gauge-ts
path: ./artifacts

- name: Install gauge-ts
run: |
gauge install ts -f ./artifacts/gauge-ts-*.zip
npx gauge install ts -f ./artifacts/gauge-ts-*.zip
shell: bash

- name: Initialize a sample project
- name: Run functional tests
run: |
mkdir sample
cd sample
gauge init ts
npm install ../artifacts/gauge-ts-*.tgz
npm run test -w e2e
shell: bash

- name: Run sample project
run: |
cd sample
gauge run specs
44 changes: 18 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,30 @@ jobs:
CI: true

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-node@v1
- uses: actions/setup-node@v4
with:
node-version: '10.x'
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'

- run: npm install
- name: package
run: |
npm build
./build.sh package
- name: Setup git
run: |
git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
- run: Install dependencies
npm install

- name: Package
working-directory: gauge-ts
run: |
npm build
./build.sh package
- name: Deploy on github
working-directory: gauge-ts
run: |
cd artifacts
version=$(ls gauge-ts* | head -1 | sed "s/\.[^\.]*$//" | sed "s/gauge-ts-//" | sed "s/-[a-z]*\.[a-z0-9_]*$//");
Expand All @@ -40,37 +45,24 @@ jobs:
fi
echo -e "gauge-ts v$version\n\n" > desc.txt
release_description=$(ruby -e "$(curl -sSfL https://github.com/getgauge/gauge/raw/master/build/create_release_text.rb)" BugDiver gauge-ts)
release_description=$(ruby -e "$(curl -sSfL https://github.com/getgauge/gauge/raw/master/build/create_release_text.rb)" getgauge gauge-ts)
echo "$release_description" >> desc.txt
echo "Creating new draft for release v$version"
hub release create -F ./desc.txt "v$version"
gh release create "v$version" ./desc.txt
sleep 10
echo "Start uploading assets..."
for i in `ls $artifacts`; do
hub release edit -m "" -a $i "v$version"
gh release upload "v$version" $i
done
cat desc.txt
rm -rf desc.txt
- name: Deploy npm
working-directory: gauge-ts
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
npm publish --access=public
- name: 'deployment success'
if: success()
uses: 'deliverybot/status@master'
with:
state: 'success'
token: '${{ secrets.GITHUB_TOKEN }}'

- name: 'deployment failure'
if: failure()
uses: 'deliverybot/status@master'
with:
state: 'failure'
token: '${{ secrets.GITHUB_TOKEN }}'
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@ yarn-debug.log*
yarn-error.log*
deploy/
artifacts/
*.tgz
*.tgz
.zed
.gauge
logs
reports
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "gauge-proto"]
path = gauge-proto
url = https://github.com/getgauge/gauge-proto.git
url = git@github.com:getgauge/gauge-proto.git
1 change: 1 addition & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run precommit
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ tests
jest*
TODO*
ts*
launcher.js
launcher.mjs
azure*
.gitmodules
*.ps1
Expand Down
22 changes: 6 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,10 @@
# Gauge-Ts

[![Actions Status](https://github.com/bugdiver/gauge-ts/workflows/Node%20CI/badge.svg)](https://github.com/BugDiver/gauge-ts/actions)
[![codecov](https://codecov.io/gh/BugDiver/gauge-ts/branch/master/graph/badge.svg)](https://codecov.io/gh/BugDiver/gauge-ts)
[![npm version](https://badge.fury.io/js/gauge-ts.svg)](https://badge.fury.io/js/gauge-ts)

This project adds typescript [language plugin](https://docs.gauge.org/latest/installation.html#language-runner) for [gauge](http://gauge.org).
This project adds Typescript [language plugin](https://docs.gauge.org/latest/installation.html#language-runner) for [gauge](http://gauge.org).

The plugin is authored in [typescript](https://en.wikipedia.org/wiki/TypeScript).

## Getting started

Refer https://bugdiver.dev/gauge-ts

## Deveopement
## Development

#### Build from Source

Expand All @@ -23,29 +15,27 @@ Refer https://bugdiver.dev/gauge-ts
- [JQ](https://stedolan.github.io/jq/) (for unix)


Running `build.sh`(*nix), or `.\build.ps1`(windwos/powershell) should give the list of all tasks available. Below sections detail some commonly used tasks.
Running `build.sh`(*nix), or `.\build.ps1`(windows/powershell) should give the list of all tasks available. Below sections detail some commonly used tasks.

##### Compiling

To compile typescript to commonjs:
To compile Typescript to commonjs:

````
./build.sh | .\build.ps1 build
````

##### Installing

To install the the typescript plugin use(Note, this will uninstall gauge-ts before installing the compiled version):
To install the the typescript plugin use (Note, this will uninstall gauge-ts before installing the compiled version):

````
./build.sh | .\build.ps1 package
./build.sh | .\build.ps1 forceinstall
````

##### Creating distributable
##### Creating the package

````
./build.sh | .\build.ps1 package
````

New distribution details need to be updated in the dotnet-install.json file in [gauge plugin repository](https://github.com/getgauge/gauge-repository) for a new verison update.
15 changes: 15 additions & 0 deletions biome.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"files": {
"ignore": [
"dist/**",
"node_modules",
"src/gen",
".vscode",
"reports",
".gauge"
]
},
"formatter": {
"indentStyle": "space"
}
}
3 changes: 0 additions & 3 deletions config.ts

This file was deleted.

Loading

0 comments on commit 9f417b9

Please sign in to comment.