Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 into plugin-hover
  • Loading branch information
TwitchBronBron committed Jul 19, 2022
2 parents f007b26 + ddcb7b2 commit bcbc041
Show file tree
Hide file tree
Showing 180 changed files with 40,281 additions and 5,655 deletions.
36 changes: 32 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ module.exports = {
'@typescript-eslint/explicit-member-accessibility': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/init-declarations': 'off',
'@typescript-eslint/parameter-properties': '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',
Expand All @@ -40,6 +42,15 @@ module.exports = {
'@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
Expand Down Expand Up @@ -70,7 +81,9 @@ module.exports = {
'@typescript-eslint/require-array-sort-compare': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/sort-type-union-intersection-members': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/space-infix-ops': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/typedef': 'off',
'@typescript-eslint/unbound-method': 'off',
Expand Down Expand Up @@ -139,11 +152,8 @@ module.exports = {
'no-underscore-dangle': 'off',
'no-unneeded-ternary': 'off',
'no-useless-escape': 'off',
'no-void': 'off',
'no-warning-comments': 'off',
'object-curly-spacing': [
'error',
'always'
],
'object-property-newline': 'off',
'object-shorthand': [
'error',
Expand All @@ -165,6 +175,7 @@ module.exports = {
'sort-imports': 'off',
'sort-keys': 'off',
'spaced-comment': 'off',
'space-infix-ops': 'off',
'vars-on-top': 'off',
'wrap-regex': 'off'
},
Expand All @@ -190,6 +201,7 @@ module.exports = {
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars-experimental': 'off',
'@typescript-eslint/dot-notation': 'off',
'@typescript-eslint/no-unsafe-argument': 'off',
'github/array-foreach': 'off',
'new-cap': 'off',
'no-shadow': 'off',
Expand All @@ -201,5 +213,21 @@ module.exports = {
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-var-requires': 'off'
}
}, {
files: ['src/roku-types/data.json'],
rules: {
'@typescript-eslint/no-unused-expressions': 'off',
'@typescript-eslint/quotes': 'off',
'no-template-curly-in-string': 'off',
'eol-last': 'off',
'@typescript-eslint/semi': 'off'
}
}, {
files: ['scripts/**/*.ts'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-require-imports': 'off',
'camelcase': 'off'
}
}]
};
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ jobs:
- uses: actions/checkout@master
- uses: actions/setup-node@master
with:
node-version: "10.19.0"
node-version: "12.22.7"
- run: npm ci
- run: npm run build
- run: npm run lint
- run: npm run test
- run: npm run publish-coverage
- run: npm run test-related-projects
npm-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')
Expand All @@ -37,6 +38,7 @@ jobs:
- run: npm run build
#create npm package
- run: npm pack
- run: npm run test-related-projects

#create GitHub release
- name: Create GitHub Release
Expand All @@ -58,5 +60,7 @@ jobs:
with:
asset_paths: '["./*.tgz"]'

#If there's a dash followed by an alpha character, this is a prerelease and should be tagged "next". Otherwise tag as "latest"
- run: if [[ "${{ github.ref }}" =~ -[a-zA-Z] ]]; then echo "DIST_TAG=next" >> $GITHUB_ENV; else echo "DIST_TAG=latest" >> $GITHUB_ENV; fi
#upload to npm
- run: npm publish
- run: npm publish --tag ${{env.DIST_TAG}}
42 changes: 42 additions & 0 deletions .github/workflows/create-vsix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: create-vsix
on:
pull_request:
types: [labeled, unlabeled, synchronize]
jobs:
create-vsix:
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/github-app-token@v1
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/workflow-dispatch@v2.1.1
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 download the .vsix [here](${{steps.create-vsix.outputs.workflow-url}}) and then follow [these installation instructions](https://github.com/rokucommunity/vscode-brightscript-language#pre-release-versions).'
})
70 changes: 44 additions & 26 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,13 @@
"version": "0.2.0",
"configurations": [
{
"name": "Launch Program",
"program": "${workspaceFolder}/benchmarks/index.js",
"request": "launch",
"args": [
"--versions",
"current",
"--targets",
"lexer",
"--noprepare",
"--project",
"C:/projects/roku/brighterscript-template"
],
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
},
{
"name": "Debug Tests (Current file)",
"type": "node",
"name": "Debug Tests",
"type": "pwa-node",
"request": "launch",
"smartStep": true,
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"sourceMaps": true,
"args": [
"${relativeFile}",
"--timeout",
"987654"
],
Expand All @@ -36,17 +17,54 @@
"<node_internals>/**/*.js"
],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"internalConsoleOptions": "openOnSessionStart",
"resolveSourceMapLocations": [
"${workspaceFolder}/**",
"!**/node_modules/typescript/**",
"!**/node_modules/vscode-languageserver/**"
"!**/node_modules/vscode-languageserver*/**"
]
},
{
"name": "Debug Doc Generator",
"type": "node",
"type": "pwa-node",
"request": "launch",
"args": [
"scripts/compile-doc-examples.ts"
],
"runtimeArgs": [
"--nolazy",
"-r",
"ts-node/register"
],
"sourceMaps": true,
"cwd": "${workspaceRoot}",
"resolveSourceMapLocations": [
"${workspaceFolder}/**",
"!**/node_modules/typescript/**",
"!**/node_modules/vscode-languageserver/**"
]
},
{
"name": "Debug Benchmarks",
"program": "${workspaceFolder}/benchmarks/index.js",
"request": "launch",
"args": [
"--versions",
"current",
"--targets",
"lexer",
"--noprepare",
"--project",
"C:/projects/roku/brighterscript-template"
],
"skipFiles": [
"<node_internals>/**"
],
"type": "pwa-node"
},
{
"name": "Debug Roku Docs Scraper",
"type": "pwa-node",
"request": "launch",
"runtimeExecutable": "node",
"runtimeArgs": [
Expand All @@ -55,7 +73,7 @@
"ts-node/register/transpile-only"
],
"args": [
"scripts/compile-doc-examples.ts"
"scripts/scrape-roku-docs.ts"
],
"cwd": "${workspaceRoot}",
"internalConsoleOptions": "openOnSessionStart",
Expand All @@ -65,4 +83,4 @@
]
}
]
}
}
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@
"editor.tabSize": 4,
"editor.insertSpaces": true,
"typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
"typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"files.trimTrailingWhitespace": true
}
32 changes: 31 additions & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,18 @@
"$tsc"
]
},
{
"label": "watch",
"type": "npm",
"script": "watch",
"presentation": {
"group": "watch"
},
"isBackground": true,
"problemMatcher": [
"$tsc-watch"
]
},
{
"type": "npm",
"script": "lint",
Expand All @@ -32,10 +44,28 @@
"test:nocover",
"--silent"
],
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "shared",
"showReuseMessage": true,
"clear": true
},
"group": {
"kind": "test",
"isDefault": true
},
"problemMatcher": []
},
{
"label": "scrape-roku-docs",
"type": "shell",
"command": "npm",
"args": [
"run",
"scrape-roku-docs"
],
"presentation": {
"echo": true,
"reveal": "always",
Expand All @@ -47,4 +77,4 @@
"problemMatcher": []
}
]
}
}
Loading

0 comments on commit bcbc041

Please sign in to comment.