Skip to content

Commit

Permalink
Run tsdoc on PRs, move build to a subdir, fix warnings (#130)
Browse files Browse the repository at this point in the history
The tsdoc build broke recently because of the inclusion of VideoFrame.
This fixes that, and prevents it from happening again. It also moves the
build to a subdirectory cleans up the dependencies for more tests in the
next PR.

I had to replace the TypeDoc API usage with a command-line invocation
because I can't figure out how to enable treatWarningsAsErrors and then
exit>0 in the API usage.
  • Loading branch information
kainino0x authored Jun 21, 2023
1 parent dabaf74 commit 5d0a7ff
Show file tree
Hide file tree
Showing 11 changed files with 169 additions and 249 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/deploy-to-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Build and Deploy
on:
pull_request:
branches:
- main
push:
branches:
- main
Expand All @@ -17,14 +20,13 @@ jobs:
with:
node-version: '16.x'

- name: Install and Build 🏭
run: |
npm ci
npm run build-ci
- run: npm ci
- run: npm run build-docs

- name: Deploy 📦
if: ${{ success() && github.ref == 'refs/heads/main' }}
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: out
FOLDER: tsdoc-src/out
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/dist/
/node_modules/
/out/
/generated/webgpu.ts
node_modules
.DS_Store
42 changes: 0 additions & 42 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1066,48 +1066,6 @@ interface GPUProgrammableStage {
* Values are specified as <dfn typedef for="">GPUPipelineConstantValue</dfn>, which is a {@link double}.
* They are converted [$to WGSL type$] of the pipeline-overridable constant (`bool`/`i32`/`u32`/`f32`/`f16`).
* If conversion fails, a validation error is generated.
* <div class=example>
* Pipeline-overridable constants defined in WGSL:
* <pre highlight=wgsl>
* @id(0) override has_point_light: bool = true; // Algorithmic control.
* @id(1200) override specular_param: f32 = 2.3; // Numeric control.
* @id(1300) override gain: f32; // Must be overridden.
* override width: f32 = 0.0; // Specifed at the API level
* // using the name "width".
* override depth: f32; // Specifed at the API level
* // using the name "depth".
* // Must be overridden.
* override height = 2 * depth; // The default value
* // (if not set at the API level),
* // depends on another
* // overridable constant.
* </pre>
* Corresponding JavaScript code, providing only the overrides which are required
* (have no defaults):
* <pre highlight=js>
* {
* // ...
* constants: {
* 1300: 2.0, // "gain"
* depth: -1, // "depth"
* }
* }
* </pre>
* Corresponding JavaScript code, overriding all constants:
* <pre highlight=js>
* {
* // ...
* constants: {
* 0: false, // "has_point_light"
* 1200: 3.0, // "specular_param"
* 1300: 2.0, // "gain"
* width: 20, // "width"
* depth: -1, // "depth"
* height: 15, // "height"
* }
* }
* </pre>
* </div>
*/
constants?: Record<
string,
Expand Down
176 changes: 1 addition & 175 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@
"dist/**/*"
],
"scripts": {
"build-docs": "node make-webgpu-docs.mjs",
"build-ci": "npm run build-docs",
"test": "for t in tests/* ; do (cd \"$t\" && npm i && npm test); done",
"build-docs": "cd tsdoc-src && npm ci && npm run build",
"generate": "bikeshed-to-ts --in ./gpuweb/spec/index.bs --out ./generated/index.d.ts --forceGlobal --nominal && prettier -w generated/index.d.ts",
"format": "prettier -w dist/index.d.ts"
},
"devDependencies": {
"bikeshed-to-ts": "github:toji/bikeshed-to-ts",
"prettier": "^2.2.1",
"typedoc": "^0.23.22",
"typescript": "4.6.4"
"prettier": "^2.2.1"
}
}
Loading

0 comments on commit 5d0a7ff

Please sign in to comment.