Implement renderInstructions in themer-wallpaper-diamonds
This commit is contained in:
parent
f593d9e898
commit
67f01ea123
@ -35,3 +35,4 @@ to which you would pass `<width>x<height>`. For example, to forego the default r
|
|||||||
|
|
||||||
themer -c my-colors.js -t themer-wallpaper-diamonds --themer-wallpaper-diamonds-size 1024x768 --themer-wallpaper-diamonds-size 320x960 -o gen
|
themer -c my-colors.js -t themer-wallpaper-diamonds --themer-wallpaper-diamonds-size 1024x768 --themer-wallpaper-diamonds-size 320x960 -o gen
|
||||||
|
|
||||||
|
The generated files will be listed in `<output dir>/README.md`.
|
||||||
|
@ -0,0 +1,10 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`themer "diamonds" wallpaper should list outputfiles 1`] = `
|
||||||
|
"
|
||||||
|
Files generated:
|
||||||
|
|
||||||
|
* \`themer-wallpaper-diamonds-dark-1000x1000.svg\`
|
||||||
|
* \`themer-wallpaper-diamonds-light-1000x1000.svg\`
|
||||||
|
"
|
||||||
|
`;
|
@ -2,6 +2,7 @@ const {
|
|||||||
getSizesFromOptOrDefault,
|
getSizesFromOptOrDefault,
|
||||||
deepFlatten,
|
deepFlatten,
|
||||||
colorSets: getColorSets,
|
colorSets: getColorSets,
|
||||||
|
listOutputFiles,
|
||||||
} = require('themer-utils');
|
} = require('themer-utils');
|
||||||
|
|
||||||
const SIZE = 100;
|
const SIZE = 100;
|
||||||
@ -127,4 +128,7 @@ const render = (colors, options) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { render };
|
module.exports = {
|
||||||
|
render,
|
||||||
|
renderInstructions: listOutputFiles,
|
||||||
|
};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
const { render } = require('./index');
|
const { render, renderInstructions } = require('./index');
|
||||||
const { colors } = require('../../themer-colors-default');
|
const { colors } = require('../../themer-colors-default');
|
||||||
|
|
||||||
describe('themer "diamonds" wallpaper', () => {
|
describe('themer "diamonds" wallpaper', () => {
|
||||||
@ -8,4 +8,9 @@ describe('themer "diamonds" wallpaper', () => {
|
|||||||
expect(file.contents.toString('utf8')).not.toContain('undefined');
|
expect(file.contents.toString('utf8')).not.toContain('undefined');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
it('should list outputfiles', async () => {
|
||||||
|
const files = await Promise.all(render(colors, { 'themer-wallpaper-diamonds-size': '1000x1000' }));
|
||||||
|
const instructions = renderInstructions(files.map(({ name }) => name));
|
||||||
|
expect(instructions).toMatchSnapshot();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/mjswensen/themer/tree/master/cli/packages/themer-wallpaper-diamonds#readme",
|
"homepage": "https://github.com/mjswensen/themer/tree/master/cli/packages/themer-wallpaper-diamonds#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"themer-utils": "^1.0.0"
|
"themer-utils": "^1.2.0"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"themer": "^3"
|
"themer": "^3"
|
||||||
|
Loading…
Reference in New Issue
Block a user