From 6b79ba8d8b135f044fa2582f3b16f2fd87477bc2 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Fri, 28 Jun 2024 15:09:32 -0700 Subject: [PATCH] use rollup for show-errors.js --- README.md | 4 ++-- package.json | 1 - rollup.config.js | 13 +++++++++++++ tsconfig-show-errors.json | 20 -------------------- 4 files changed, 15 insertions(+), 23 deletions(-) delete mode 100644 tsconfig-show-errors.json diff --git a/README.md b/README.md index 4c66828..a824245 100644 --- a/README.md +++ b/README.md @@ -95,9 +95,9 @@ examples and inject the helper. Ideally there should be no errors. You can skip the first N tests with `-- --skip-count=` (the first `--` is required). -### show-errors.js +### `show-errors.js` -You can generate show-errors.js with `npm run build-show-errors`. +`show-errors/show-errors.js` is also generated by the build. show-errors.js wraps calls to `pushErrorScope` and `popErrorScope` around every method of `GPUDevice` and `GPUQueue`. It is used in the diff --git a/package.json b/package.json index c03ea12..13f6228 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ "scripts": { "build": "npm run make", "build-ci": "npm run build && node build/tools/prep-for-deploy.js", - "build-show-errors": "tsc --project tsconfig-show-errors.json", "make": "rollup -c", "check": "npm run lint", "check-ci": "npm run pre-push", diff --git a/rollup.config.js b/rollup.config.js index e8e8e5a..8cb8011 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -27,4 +27,17 @@ export default [ ], plugins, }, + { + input: `src/error-scope-wrapper.ts`, + output: [ + { + file: `show-errors/show-errors.js`, + format: 'umd', + sourcemap: false, + freeze: false, + banner: `/* show-errors@${pkg.version}, license MIT */`, + }, + ], + plugins, + }, ]; diff --git a/tsconfig-show-errors.json b/tsconfig-show-errors.json deleted file mode 100644 index 3db4bb9..0000000 --- a/tsconfig-show-errors.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "target": "ESNext", - "module": "AMD", - "outFile": "show-errors/show-errors.js", - "allowJs": true, - "declaration": false, - "typeRoots": [ - "./node_modules/@webgpu/types", - "./node_modules/@types", - ], - }, - - "include": [ - "src/error-scope-wrapper.ts", - ], - "typeAcquisition": { - "include": ["@webgpu/types"] - } -} \ No newline at end of file