Skip to content

Commit

Permalink
Add debug script for printing detected fixture files #494
Browse files Browse the repository at this point in the history
  • Loading branch information
ovidiuch committed Nov 5, 2017
1 parent b01affb commit 33b9182
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/react-cosmos-webpack/bin/print-fixture-files.js
@@ -0,0 +1,9 @@
#!/usr/bin/env node

// Do this as the first thing so that any code reading it knows the right env.
process.env.BABEL_ENV = 'development';
process.env.NODE_ENV = 'development';

const printFixtureFiles = require('../lib/server/print-fixture-files').default;

printFixtureFiles();
@@ -0,0 +1,9 @@
import getCosmosConfig from 'react-cosmos-config';
import { findFixtureFiles } from 'react-cosmos-voyager2/lib/server';

export default async function printFixtureFiles() {
const cosmosConfig = getCosmosConfig();
const fixtureFiles = await findFixtureFiles(cosmosConfig);

console.log(JSON.stringify(fixtureFiles, null, 2));
}

0 comments on commit 33b9182

Please sign in to comment.