Skip to content

Commit f1546e3

Browse files
Merge pull request #1 from rokucommunity/adoption
refactor in preparation for adoption the project
2 parents 9d986b6 + b2d223a commit f1546e3

File tree

13 files changed

+18073
-5117
lines changed

13 files changed

+18073
-5117
lines changed

.github/workflows/build.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
tags:
7+
- v*
8+
pull_request:
9+
10+
jobs:
11+
ci:
12+
runs-on: ${{ matrix.os }}
13+
env:
14+
#hardcode the coveralls token...it's not overly important to protect, and github actions won't allow forks to work with coveralls otherwise
15+
COVERALLS_REPO_TOKEN: 83xyW4IxLCtIw0LxM8NoMeRDGWj8bYYq5
16+
CI: true
17+
strategy:
18+
matrix:
19+
os: [ubuntu-latest] #, macos-latest, windows-latest]
20+
steps:
21+
- uses: actions/checkout@master
22+
- uses: actions/setup-node@master
23+
with:
24+
node-version: "12.22.7"
25+
- run: npm ci
26+
- run: npm run build
27+
- run: npm run lint
28+
- run: npm run prettier
29+
- run: npm run test
30+
- run: npm run publish-coverage
31+
npm-release:
32+
#only run this task if a tag starting with 'v' was used to trigger this (i.e. a tagged release)
33+
if: startsWith(github.ref, 'refs/tags/v')
34+
needs: ci
35+
runs-on: ubuntu-latest
36+
env:
37+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
38+
steps:
39+
- uses: actions/checkout@master
40+
- uses: actions/setup-node@master
41+
with:
42+
node-version: "12.22.7"
43+
- run: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ./.npmrc
44+
- run: npm ci
45+
- run: npm run build
46+
#create npm package
47+
- run: npm pack
48+
49+
#create GitHub release
50+
- name: Create GitHub Release
51+
id: create_release
52+
uses: actions/create-release@latest
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
with:
56+
tag_name: ${{ github.ref }}
57+
release_name: ${{ github.ref }}
58+
draft: false
59+
prerelease: false #contains(github.ref, '-beta.') == true
60+
61+
#upload package to GitHub release
62+
- name: Upload GitHub Release Assets
63+
uses: alexellis/upload-assets@0.2.3
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
with:
67+
asset_paths: '["./*.tgz"]'
68+
69+
#upload to npm
70+
- run: npm publish

.github/workflows/nightly-build.yaml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/pull-request.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.github/workflows/release.yaml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ lib/
33
types/
44
node_modules/
55
.vscode/
6+
coverage/

.travis.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Since this project is still maturing, many of its initial contributions will tak
1515

1616
## Submitting Issues
1717

18-
If you find something wrong with `brs`, or something doesn't seem right, feel free to [open a new issue](https://github.com/sjbarag/brs/issues/new). Please try to avoid "how do I X in BrightScript" questions however — those are best suited for [StackOverflow](https://stackoverflow.com) or similar Q&A sites.
18+
If you find something wrong with `brs`, or something doesn't seem right, feel free to [open a new issue](https://github.com/rokucommunity/brs/issues/new). Please try to avoid "how do I X in BrightScript" questions however — those are best suited for [StackOverflow](https://stackoverflow.com) or similar Q&A sites.
1919

2020
### Bug Reports
2121

@@ -43,7 +43,7 @@ Regardless of whether you're fixing bugs or implementing new features, there's a
4343

4444
1. Comment on the issue and tell us that you're intereseted in working on it. This should lower the (admittedly rare) chances of someone stealing your that bug/feature from you :smile:.
4545
1. Create a fork of this repo if you haven't already
46-
1. Send us a [pull request](https://github.com/sjbarag/brs/pulls)!
46+
1. Send us a [pull request](https://github.com/rokucommunity/brs/pulls)!
4747

4848
### Adding a component
4949

@@ -53,6 +53,6 @@ For guidelines on adding a component to `brs`, see [this doc](docs/AddingCompone
5353

5454
There aren't to many mandatory things for pull requests, besides what you'd expect from any open-source project (e.g. "don't delete all the code", "don't delete a user's home directory at runtime"). The most important project-specific "must-haves" that we'll look for that are:
5555

56-
1. Pull requests should be based on a pretty recent version of the `main` branch, to minimize merge conflicts.
56+
1. Pull requests should be based on a pretty recent version of the `master` branch, to minimize merge conflicts.
5757
1. All tests should pass (Travis CI will let us know if any fail).
5858
1. End to end tests written in BrightScript should be present to exercise the bug or new feature. These don't need to be exhaustive — just enough to ensure that the major use-cases are covered. More in-depth testing can happen via unit test.

README.md

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,13 @@
2424
# BRS: Off-Roku BrightScript
2525
An interpreter for the BrightScript language that runs on non-Roku platforms.
2626

27-
[![CircleCI](https://circleci.com/gh/sjbarag/brs.svg?style=svg)](https://circleci.com/gh/sjbarag/brs)
28-
[![NPM Version](https://badge.fury.io/js/brs.svg?style=flat)](https://npmjs.org/package/brs)
27+
[![build status](https://img.shields.io/github/actions/workflow/status/rokucommunity/brs/build.yml?branch=master&logo=github)](https://github.com/rokucommunity/brs/actions?query=branch%3Amaster+workflow%3Abuild)
28+
[![coverage status](https://img.shields.io/coveralls/github/rokucommunity/brs?logo=coveralls)](https://coveralls.io/github/rokucommunity/brs?branch=master)
29+
[![monthly downloads](https://img.shields.io/npm/dm/@rokucommunity/brs.svg?sanitize=true&logo=npm&logoColor=)](https://npmcharts.com/compare/@rokucommunity/brs?minimal=true)
30+
[![npm version](https://img.shields.io/npm/v/@rokucommunity/brs.svg?logo=npm)](https://www.npmjs.com/package/@rokucommunity/brs)
31+
[![license](https://img.shields.io/github/license/rokucommunity/brs.svg)](LICENSE)
32+
[![Slack](https://img.shields.io/badge/Slack-RokuCommunity-4A154B?logo=slack)](https://join.slack.com/t/rokudevelopers/shared_invite/zt-4vw7rg6v-NH46oY7hTktpRIBM_zGvwA)
33+
2934

3035
## Installation
3136
The BRS project is published as a `node` package, so use `npm`:
@@ -34,12 +39,6 @@ The BRS project is published as a `node` package, so use `npm`:
3439
$ npm install -g brs
3540
```
3641

37-
or `yarn` if that's your preference:
38-
39-
```shell
40-
$ yarn global add brs
41-
```
42-
4342
## Usage
4443
This repo provides the `brs` executable, which operates in two ways.
4544

@@ -77,32 +76,23 @@ The BRS project follows pretty standard `node` development patterns, with the ca
7776
### Prerequisites
7877
BRS builds (and runs) in `node`, so you'll need to [install that first](https://nodejs.org).
7978

80-
Once that's ready, install [yarn](https://yarnpkg.com). Installing it with `npm` is probably the simplest:
81-
82-
```shell
83-
$ npm install -g yarn
84-
```
8579
### Setup
8680
1. Clone this repo:
8781
```
88-
$ git clone https://github.com/sjbarag/brs.git
82+
$ git clone https://github.com/rokucommunity/brs.git
8983
```
9084

9185
2. Install dependencies:
9286
```shell
93-
$ yarn install # or just `yarn`
87+
$ npm install
9488
```
9589

96-
3. Get `brs` onto your `PATH`:
97-
``` shell
98-
$ yarn link
99-
```
10090
### The build-test-clean dance
10191
#### Build
102-
This project is written in TypeScript, so it needs to be compiled before it can be executed. `yarn build` compiles files in `src/` into JavaScript and TypeScript declarations, and puts them in `lib/` and `types/` respectively.
92+
This project is written in TypeScript, so it needs to be compiled before it can be executed. `npm run build` compiles files in `src/` into JavaScript and TypeScript declarations, and puts them in `lib/` and `types/` respectively.
10393

10494
```shell
105-
$ yarn build
95+
$ npm run build
10696
10797
$ ls lib/
10898
index.js (and friends)
@@ -111,17 +101,17 @@ $ ls types/
111101
index.d.ts (and friends)
112102
```
113103

114-
Alternatively, you can run the build step in "watch" mode. This will run `yarn build` for you automatically, every time it detects source file changes:
104+
Alternatively, you can run the build step in "watch" mode. This will run `npm run build` for you automatically, every time it detects source file changes:
115105
```shell
116-
$ yarn watch
106+
$ npm run watch
117107
```
118-
This is often useful for testing that local changes work in your BrightScript project, without having to run `yarn build` over and over.
108+
This is often useful for testing that local changes work in your BrightScript project, without having to run `npm run build` over and over.
119109

120110
#### Testing
121111
Tests are written in plain-old JavaScript with [Facebook's Jest](http://facebook.github.io/jest/), and can be run with the `test` target:
122112
123113
```shell
124-
$ yarn test
114+
$ npm run test
125115
126116
# tests start running
127117
```

docs/AddingComponents.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This is aimed to be a quick guide for adding a component to `brs`. Note that this may not be comprehensive in all cases, but is a general plan of attack. Here are the steps you should take:
44

55
1. Find the documentation for your component on [Roku's developer docs](https://developer.roku.com). For example, the documentation for the `Group` component can be found [here](https://developer.roku.com/en-gb/docs/references/scenegraph/layout-group-nodes/group.md).
6-
1. Create a file in the [components directory](https://github.com/sjbarag/brs/tree/main/src/brsTypes/components) called `<insert component name>.ts`.
6+
1. Create a file in the [components directory](https://github.com/rokucommunity/brs/tree/master/src/brsTypes/components) called `<insert component name>.ts`.
77
1. Copy the following code and paste it into your new file:
88

99
```
@@ -26,9 +26,9 @@ This is aimed to be a quick guide for adding a component to `brs`. Note that thi
2626
```
2727
2828
1. Replace all `<insert component name>` and `<insert parent component>` from above with your component name. Add any built-in fields and/or class functions that the Roku docs specify.
29-
1. Add a constructor definition to the [component factory](https://github.com/sjbarag/brs/blob/main/src/brsTypes/components/ComponentFactory.ts). This will allow instances of your new component to be created dynamically when it is encountered in XML or BrightScript code.
30-
1. Add a test case for your Typescript class in [the components test directory](https://github.com/sjbarag/brs/tree/main/test/brsTypes/components). Use the existing component test files in that directory as a model for what your test should look like.
29+
1. Add a constructor definition to the [component factory](https://github.com/rokucommunity/brs/blob/main/src/brsTypes/components/ComponentFactory.ts). This will allow instances of your new component to be created dynamically when it is encountered in XML or BrightScript code.
30+
1. Add a test case for your Typescript class in [the components test directory](https://github.com/rokucommunity/brs/tree/master/test/brsTypes/components). Use the existing component test files in that directory as a model for what your test should look like.
3131
1. Add an end-to-end test case.
32-
- Create a file in [the end-to-end directory](https://github.com/sjbarag/brs/tree/main/test/e2e) called `<insert component name>.brs`. In the file, write BrightScript code that exercises your component functionality.
33-
- Add an XML file to the [the components test directory](https://github.com/sjbarag/brs/tree/main/test/brsTypes/components) that uses your component.
34-
- Add a test block to [BrsComponents.test.js](https://github.com/sjbarag/brs/blob/main/test/e2e/BrsComponents.test.js). In this block, verify that the code from your XML and Brightscript files is behaving as expected.
32+
- Create a file in [the end-to-end directory](https://github.com/rokucommunity/brs/tree/master/test/e2e) called `<insert component name>.brs`. In the file, write BrightScript code that exercises your component functionality.
33+
- Add an XML file to the [the components test directory](https://github.com/rokucommunity/brs/tree/master/test/brsTypes/components) that uses your component.
34+
- Add a test block to [BrsComponents.test.js](https://github.com/rokucommunity/brs/blob/main/test/e2e/BrsComponents.test.js). In this block, verify that the code from your XML and Brightscript files is behaving as expected.

0 commit comments

Comments
 (0)