Skip to content

Commit fc18a22

Browse files
Create object validation (#435)
* started bulding the scraper * Added component scraping support * Added better signature handling * Start collecting interface data * Scrape roku docs websites for interfaces too * rename script. * fix bugs finding interface implementors. generate ts file instead of json * First pass for events * remove eslint overrides for nonexistant data.ts file * better data exporting * fix lint issue * collect basic descriptions * Reference non-localized docs * start parsing markdown instead of html * Use markdown parser for `implementedBy`. * Add better typing support for tables. * Remove nested signatures array in favor of duplicate methods * Convert interface method scraping to use markdown * Removed default parameter value for components * Collect all description markdown for components, interfaces and events * Remove extraneous commas from descriptions * Collect "availableSince" for main item * move interfaces to bottom of the file * Make more generic markdown retrieving methods * use markdown parser for "implementedBy" table * restructure class * Fix "implemented by" bugs in some markdown docs * Rename Implementor to Implementer * Add interface implementers list. * Remove jsdom entirely in favor of marked * fix ci build issue * Repair doc urls in descriptions. Collect SGNode items. * exclude "overview" component pages * Collect scenegraph node fields * Commiting files * Tests * Fixed tests - made sure to check actual unquoted string values in createObject validation * small tsconfig fixes * Added Diagnostic and validation for unknown brightscript component in createObject() call * Added additional logic to check for mismatch in CreateObject argument count (#561) * Added additional logic to check for mismatch in CrateObject argument count * Fixed scraping code, and gracefully handles bad createObject docs * Moved constructor push out of loop * Updated to latest version of marked library * Removed commented code * Add merge logic for overrides * Add doc url for RSGPalette * Added missing deepmerge package * Scapes docs for deprecation status, adds it to data.json, and adds a validation for CreateObject(<deprecated>) * Lint fix * Sorts data.json so nodes, compoenents, interfaces, events, properties, methods, implementors etc. are in alphabetical order * add basic typedef generation (WIP) Co-authored-by: Mark Pearce <mark.pearce@redspace.com> Co-authored-by: Mark Pearce <markwpearce@gmail.com>
1 parent 4c0658f commit fc18a22

File tree

17 files changed

+23547
-483
lines changed

17 files changed

+23547
-483
lines changed

.eslintrc.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,5 +209,14 @@ module.exports = {
209209
'@typescript-eslint/no-require-imports': 'off',
210210
'@typescript-eslint/no-var-requires': 'off'
211211
}
212+
}, {
213+
files: ['src/roku-types/data.json'],
214+
rules: {
215+
'@typescript-eslint/no-unused-expressions': 'off',
216+
'@typescript-eslint/quotes': 'off',
217+
'no-template-curly-in-string': 'off',
218+
'eol-last': 'off',
219+
'@typescript-eslint/semi': 'off'
220+
}
212221
}]
213222
};

.vscode/launch.json

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,26 @@
6464
"!**/node_modules/typescript/**",
6565
"!**/node_modules/vscode-languageserver/**"
6666
]
67+
},
68+
{
69+
"name": "Debug Roku Docs Scraper",
70+
"type": "node",
71+
"request": "launch",
72+
"runtimeExecutable": "node",
73+
"runtimeArgs": [
74+
"--nolazy",
75+
"-r",
76+
"ts-node/register/transpile-only"
77+
],
78+
"args": [
79+
"scripts/scrape-roku-docs.ts"
80+
],
81+
"cwd": "${workspaceRoot}",
82+
"internalConsoleOptions": "openOnSessionStart",
83+
"skipFiles": [
84+
"<node_internals>/**",
85+
"node_modules/**"
86+
]
6787
}
6888
]
69-
}
89+
}

.vscode/tasks.json

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,28 @@
4444
"test:nocover",
4545
"--silent"
4646
],
47+
"presentation": {
48+
"echo": true,
49+
"reveal": "always",
50+
"focus": true,
51+
"panel": "shared",
52+
"showReuseMessage": true,
53+
"clear": true
54+
},
4755
"group": {
4856
"kind": "test",
4957
"isDefault": true
5058
},
59+
"problemMatcher": []
60+
},
61+
{
62+
"label": "scrape-roku-docs",
63+
"type": "shell",
64+
"command": "npm",
65+
"args": [
66+
"run",
67+
"scrape-roku-docs"
68+
],
5169
"presentation": {
5270
"echo": true,
5371
"reveal": "always",
@@ -59,4 +77,4 @@
5977
"problemMatcher": []
6078
}
6179
]
62-
}
80+
}

0 commit comments

Comments
 (0)