diff --git a/cli/packages/themer-wallpaper-trianglify/README.md b/cli/packages/themer-wallpaper-trianglify/README.md index eddb92c..d8f5863 100644 --- a/cli/packages/themer-wallpaper-trianglify/README.md +++ b/cli/packages/themer-wallpaper-trianglify/README.md @@ -42,3 +42,5 @@ to which you would pass `x`. For example, to forego the default r --themer-wallpaper-trianglify-variance Accepts a float between `0` and `1`, defaults to `0.75` (see [trianglify docs](https://github.com/qrohlf/trianglify#variance)). Like `--themer-wallpaper-trianglify-size`, this option can be provided multiple times—`themer` will generate a complete set of wallpapers for each value passed. + +The generated files will be listed in `/README.md`. diff --git a/cli/packages/themer-wallpaper-trianglify/lib/__snapshots__/index.spec.js.snap b/cli/packages/themer-wallpaper-trianglify/lib/__snapshots__/index.spec.js.snap index 361899d..3727689 100644 --- a/cli/packages/themer-wallpaper-trianglify/lib/__snapshots__/index.spec.js.snap +++ b/cli/packages/themer-wallpaper-trianglify/lib/__snapshots__/index.spec.js.snap @@ -7,3 +7,14 @@ exports[`themer trianglify wallpaper should allow for specifying variances 2`] = exports[`themer trianglify wallpaper should allow for specifying variances 3`] = `""`; exports[`themer trianglify wallpaper should allow for specifying variances 4`] = `""`; + +exports[`themer trianglify wallpaper should list outputfiles 1`] = ` +" +Files generated: + +* \`themer-wallpaper-trianglify-dark-1000x1000-0.5-1.svg\` +* \`themer-wallpaper-trianglify-dark-1000x1000-0.5-2.svg\` +* \`themer-wallpaper-trianglify-light-1000x1000-0.5-1.svg\` +* \`themer-wallpaper-trianglify-light-1000x1000-0.5-2.svg\` +" +`; diff --git a/cli/packages/themer-wallpaper-trianglify/lib/index.js b/cli/packages/themer-wallpaper-trianglify/lib/index.js index e828644..223ddc3 100644 --- a/cli/packages/themer-wallpaper-trianglify/lib/index.js +++ b/cli/packages/themer-wallpaper-trianglify/lib/index.js @@ -1,5 +1,5 @@ const Trianglify = require('trianglify'), - { deepFlatten } = require('themer-utils'), + { deepFlatten, listOutputFiles } = require('themer-utils'), { getSizes, getVariances } = require('./opts'); const optionNames = { @@ -55,4 +55,5 @@ const render = (colors, options) => { module.exports = { render, + renderInstructions: listOutputFiles, }; diff --git a/cli/packages/themer-wallpaper-trianglify/lib/index.spec.js b/cli/packages/themer-wallpaper-trianglify/lib/index.spec.js index 5184ba4..c83b245 100644 --- a/cli/packages/themer-wallpaper-trianglify/lib/index.spec.js +++ b/cli/packages/themer-wallpaper-trianglify/lib/index.spec.js @@ -1,5 +1,5 @@ const { colors } = require('../../themer-colors-default'), - { render } = require('./index'); + { render, renderInstructions } = require('./index'); describe('themer trianglify wallpaper', () => { it('should allow for specifying sizes', async () => { @@ -20,4 +20,17 @@ describe('themer trianglify wallpaper', () => { expect(file.contents.toString('utf8')).toMatchSnapshot(); }); }); + it('should list outputfiles', async () => { + const files = await Promise.all( + render( + colors, + { + 'themer-wallpaper-trianglify-size': '1000x1000', + 'themer-wallpaper-trianglify-variance': '0.5', + }, + ) + ); + const instructions = renderInstructions(files.map(({ name }) => name)); + expect(instructions).toMatchSnapshot(); + }); }); diff --git a/cli/packages/themer-wallpaper-trianglify/package.json b/cli/packages/themer-wallpaper-trianglify/package.json index 6527d4d..76320a2 100644 --- a/cli/packages/themer-wallpaper-trianglify/package.json +++ b/cli/packages/themer-wallpaper-trianglify/package.json @@ -21,7 +21,7 @@ "/lib/opts.js" ], "dependencies": { - "themer-utils": "^1.1.0", + "themer-utils": "^1.2.0", "trianglify": "^1.2.0" }, "devDependencies": {},