Skip to content

Commit

Permalink
chore: do not use cem cli directly
Browse files Browse the repository at this point in the history
but exec node binary to prevent cjs require errors
  • Loading branch information
davidenke committed Mar 9, 2023
1 parent 6fbe312 commit f3b2527
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions scripts/prepare-examples.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ import { basename, dirname, join, relative, resolve, sep } from 'node:path';
import { argv } from 'node:process';
import { parseArgs, promisify } from 'node:util';

// @ts-expect-error - no types
import { cli as analyzer } from '@custom-elements-manifest/analyzer/cli.js';

// load the example config
import libraries from './prepare-examples.json' assert { type: 'json' };

Expand Down Expand Up @@ -104,10 +101,11 @@ export async function createManifests(name: string, target: string, library: Lib
// prepare paths
const repository = basename(library.git, '.git');
const cwd = resolve(target, repository);
const bin = relative(cwd, join(dirname(__dirname), 'node_modules', '.bin', 'custom-elements-manifest'));
const config = relative(cwd, join(__dirname, 'prepare-examples.config.ts'));

// create manifest
await analyzer({ argv: ['analyze', '--quiet', '--config', config], cwd });
await execAsync(`${bin} analyze --quiet --config ${config}`, { cwd });

// done
console.info(`> Created manifest for ${name}.`);
Expand Down

0 comments on commit f3b2527

Please sign in to comment.