summaryrefslogtreecommitdiffstats
path: root/remote/test/puppeteer/utils/generate_artifacts.ts
blob: e150c45e2e52df61831dde4a837d81eba7ac7cfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/usr/bin/env node
import {writeFile} from 'fs/promises';
import {job} from './internal/job.js';
import {spawnAndLog} from './internal/util.js';

(async () => {
  job('', async ({outputs}) => {
    await writeFile(outputs[0]!, '{"type": "module"}');
  })
    .outputs(['lib/esm/package.json'])
    .build();

  job('', async ({outputs}) => {
    spawnAndLog('api-extractor', 'run', '--local');
    spawnAndLog(
      'eslint',
      '--ext=ts',
      '--no-ignore',
      '--no-eslintrc',
      '-c=.eslintrc.types.cjs',
      '--fix',
      outputs[0]!
    );
  })
    .inputs(['lib/esm/puppeteer/types.d.ts'])
    .outputs(['lib/types.d.ts', 'docs/puppeteer.api.json'])
    .build();
})();