Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add debug script for printing detected fixture files #494
- Loading branch information
Showing
2 changed files
with
18 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); |
9 changes: 9 additions & 0 deletions
9
packages/react-cosmos-webpack/src/server/print-fixture-files.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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)); | ||
} |