Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…htscript-language into embedded-brs-in-scenegraph
  • Loading branch information
TwitchBronBron committed Jun 30, 2023
2 parents bb2422d + 788c623 commit 9c0c2b9
Show file tree
Hide file tree
Showing 247 changed files with 36,265 additions and 15,786 deletions.
232 changes: 232 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,232 @@
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
env: {
node: true,
mocha: true,
es6: true
},
parserOptions: {
project: ['./tsconfig.json'],
createDefaultProgram: true
},
plugins: [
'@typescript-eslint',
'no-only-tests',
'github'
],
extends: [
'eslint:all',
'plugin:@typescript-eslint/all'
],
rules: {
'@typescript-eslint/parameter-properties': 'off',
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/consistent-type-assertions': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/init-declarations': 'off',
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/member-ordering': 'off',
'@typescript-eslint/method-signature-style': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/no-confusing-void-expression': 'off',
'@typescript-eslint/no-dynamic-delete': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-extra-parens': 'off',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/no-implicit-any-catch': 'off',
'@typescript-eslint/no-invalid-this': 'off',
'@typescript-eslint/no-magic-numbers': 'off',
'@typescript-eslint/no-parameter-properties': 'off',
//had to add this rule to prevent eslint from crashing
'@typescript-eslint/no-restricted-imports': ['off', {}],
//mitigating this sometimes results in undesirably verbose code. Should investigate enabling again in the future.
'@typescript-eslint/no-unsafe-argument': 'off',
'object-curly-spacing': 'off',
'@typescript-eslint/object-curly-spacing': [
'error',
'always'
],
'@typescript-eslint/no-shadow': 'off',
'@typescript-eslint/no-this-alias': 'off',
//possibly disable this once we have converted all throw statements to actual errors
'@typescript-eslint/no-throw-literal': 'off',
'@typescript-eslint/no-invalid-void': 'off',
'@typescript-eslint/no-invalid-void-type': 'off',
'@typescript-eslint/no-type-alias': 'off',
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars-experimental': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/prefer-for-of': 'off',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'@typescript-eslint/prefer-readonly': 'off',
'@typescript-eslint/prefer-readonly-parameter-types': 'off',
'@typescript-eslint/promise-function-async': 'off',
'generator-star-spacing': 'off',
'@typescript-eslint/quotes': [
'error',
'single',
{
'allowTemplateLiterals': true
}
],
'@typescript-eslint/require-array-sort-compare': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/sort-type-constituents': 'off',
'@typescript-eslint/sort-type-union-intersection-members': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/typedef': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/unified-signatures': 'off',
'array-bracket-newline': 'off',
'array-element-newline': 'off',
'array-type': 'off',
'arrow-body-style': 'off',
'arrow-parens': 'off',
'callback-return': 'off',
'capitalized-comments': 'off',
'class-methods-use-this': 'off',
'complexity': 'off',
'consistent-return': 'off',
'consistent-this': 'off',
'curly': 'error',
'default-case': 'off',
'dot-location': 'off',
'dot-notation': 'off',
'func-style': 'off',
'function-call-argument-newline': 'off',
'function-paren-newline': 'off',
'getter-return': 'off',
'github/array-foreach': 'error',
'guard-for-in': 'off',
'id-length': 'off',
'no-multi-assign': ['error', { 'ignoreNonDeclaration': true }],
'indent': 'off',
'init-declarations': 'off',
'line-comment-position': 'off',
'linebreak-style': 'off',
'lines-around-comment': 'off',
'lines-between-class-members': 'off',
'max-classes-per-file': 'off',
'max-depth': 'off',
'max-len': 'off',
'max-lines': 'off',
'max-lines-per-function': 'off',
'max-params': 'off',
'max-statements': 'off',
'no-only-tests/no-only-tests': 'error',
'multiline-comment-style': 'off',
'multiline-ternary': 'off',
'new-cap': 'off',
'newline-per-chained-call': 'off',
'no-await-in-loop': 'off',
'no-case-declarations': 'off',
'no-constant-condition': 'off',
'no-console': 'off',
'no-continue': 'off',
'no-else-return': 'off',
'no-empty': 'off',
'no-implicit-coercion': 'off',
'no-inline-comments': 'off',
'no-invalid-this': 'off',
'no-labels': 'off',
'no-lonely-if': 'off',
'no-negated-condition': 'off',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-process-exit': 'off',
'no-prototype-builtins': 'off',
'no-shadow': 'off',
'no-sync': 'off',
'no-template-curly-in-string': 'off',
'no-ternary': 'off',
'no-undefined': 'off',
'no-underscore-dangle': 'off',
'no-unneeded-ternary': 'off',
'no-useless-escape': 'off',
'no-void': 'off',
'no-warning-comments': 'off',
'object-property-newline': 'off',
'object-shorthand': [
'error',
'never'
],
'one-var': [
'error',
'never'
],
'padded-blocks': 'off',
'prefer-const': 'off',
'prefer-destructuring': 'off',
'prefer-named-capture-group': 'off',
'prefer-template': 'off',
'quote-props': 'off',
'radix': 'off',
'require-atomic-updates': 'off',
'require-unicode-regexp': 'off',
'sort-imports': 'off',
'sort-keys': 'off',
'spaced-comment': 'off',
'vars-on-top': 'off',
'wrap-regex': 'off'
},
//disable some rules for certain files
overrides: [{
//these files are getting deleted soon, so ignore the eslint warnings for now
files: ['src/brsTypes/**/*.ts'],
rules: {
'@typescript-eslint/no-invalid-this': 'off',
'@typescript-eslint/method-signature-style': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/prefer-enum-initializers': 'off'
}
}, {
files: ['scripts/**/*.ts'],
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
'no-inner-declarations': 'off'
}
}, {
files: ['*.spec.ts'],
rules: {
'@typescript-eslint/no-extraneous-class': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/no-unsafe-call': 'off',
'@typescript-eslint/no-unsafe-member-access': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars-experimental': 'off',
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/no-var-requires': 'off',
'prefer-rest-params': 'off',
'github/array-foreach': 'off',
'func-names': 'off',
'func-name-matching': 'off',
'new-cap': 'off',
'no-shadow': 'off',
'no-void': 'off'
}
}, {
files: ['benchmarks/**/*'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-var-requires': 'off'
}
}]
};
26 changes: 14 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
name: build
on:
push:
tags:
- '*'
branches:
- '*'
- master
tags:
- v*
pull_request:
branches:
- '*'

jobs:
ci:
runs-on: ${{ matrix.os }}
Expand All @@ -16,23 +15,26 @@ jobs:
COVERALLS_REPO_TOKEN: "Ysqq6q68DgojDzv3gvl5Yv029HXZYwGxq"
strategy:
matrix:
os: [ubuntu-18.04, macos-10.15, windows-2019]
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: "12.12.0"
node-version: "14.19.0"
- run: npm ci
- run: npm run build
- run: npm run lint
- run: npm run test
- run: npm run publish-coverage
# disable coverage for now (because coveralls is down right now)
#- run: npm run publish-coverage
- run: npm run package
release:
#only run this task if a tag starting with 'v' was used to trigger this (i.e. a tagged release)
if: startsWith(github.ref, 'refs/tags/v')
needs: ci
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
#the ovsx publish never quits (but the upload succeeds), so kill the build if we've taken more than 10 minutes
timeout-minutes: 10
env:
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
OPEN_VSX_TOKEN: ${{ secrets.OPEN_VSX_TOKEN }}
Expand All @@ -41,8 +43,8 @@ jobs:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: "12.12.0"
node-version: "14.19.0"

#build package
- run: npm ci
- run: npm run build
Expand Down Expand Up @@ -74,4 +76,4 @@ jobs:
- name: Publish to OpenVSX registry
#exclude beta release tags
if: contains(github.ref, '-beta.') == false
run: npx ovsx publish -p ${{env.OPEN_VSX_TOKEN}}
run: npx ovsx publish -p ${{env.OPEN_VSX_TOKEN}} --debug
41 changes: 41 additions & 0 deletions .github/workflows/create-vsix-from-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
on:
pull_request:
types: [labeled, unlabeled, synchronize]
jobs:
run:
runs-on: ubuntu-latest
if: contains(github.event.pull_request.labels.*.name, 'create-vsix')
steps:
# Get a bot token so the bot's name shows up on all our actions
- name: Get Token From roku-ci-token Application
uses: tibdex/[email protected]
id: generate-token
with:
app_id: ${{ secrets.BOT_APP_ID }}
private_key: ${{ secrets.BOT_PRIVATE_KEY }}
- name: Set New GitHub Token
run: echo "TOKEN=${{ steps.generate-token.outputs.token }}" >> $GITHUB_ENV
#trigger the build on vscode-brightscript-language
- name: Build vsix for branch "${{ github.head_ref}}"
uses: aurelien-baudet/[email protected]
id: create-vsix
with:
workflow: create-vsix
ref: master
wait-for-completion: true
display-workflow-run-url: true
repo: rokucommunity/vscode-brightscript-language
token: ${{ env.TOKEN }}
inputs: '{ "branch": "${{ github.head_ref }}"}'
#add a comment on the PR
- name: Add comment to PR
uses: actions/github-script@v5
with:
github-token: ${{ env.TOKEN }}
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Hey there! I just built a new version of the vscode extension based on ${{ github.event.pull_request.head.sha }}. You can downloaded the .vsix [here](${{steps.create-vsix.outputs.workflow-url}}) and then follow [these installation instructions](https://rokucommunity.github.io/vscode-brightscript-language/prerelease-versions.html).'
})
4 changes: 2 additions & 2 deletions .github/workflows/create-vsix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ on:
workflow_dispatch:
inputs:
branch:
description: 'The branch name which should be used to build the vsix'
description: "The branch name which should be used to build the vsix"
required: true
jobs:
create-vsix:
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
Expand Down
22 changes: 22 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: publish-docs
on:
push:
branches:
- 'master'
jobs:
publish-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: "14.19.0"
- run: npm install
- run: npm run build-docs
- name: Deploy
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: .tmp/docs
CLEAN: true # Automatically remove deleted files from the deploy branch
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ coverage
*.vsix
brsconfig.schema.json
.history
.tmp
.vsix-building
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"svelteSortOrder" : "options-scripts-styles-markup",
"svelteAllowShorthand": false,
"tabWidth": 4,
"useTabs": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSameLine": true,
"htmlWhitespaceSensitivity": "strict",
"singleAttributePerLine": false
}
Loading

0 comments on commit 9c0c2b9

Please sign in to comment.