Implement renderInstructions in themer-wallpaper-shirts
This commit is contained in:
parent
7c60412aa6
commit
0434be67ac
@ -33,3 +33,5 @@ By default, `themer-wallpaper-shirts` will output wallpapers at the following si
|
|||||||
to which you would pass `<width>x<height>`. For example, to forego the default resolutions and generate two wallpapers, one 1024 by 768 and one 320 by 960:
|
to which you would pass `<width>x<height>`. For example, to forego the default resolutions and generate two wallpapers, one 1024 by 768 and one 320 by 960:
|
||||||
|
|
||||||
themer -c my-colors.js -t themer-wallpaper-shirts --themer-wallpaper-shirts-size 1024x768 --themer-wallpaper-shirts-size 320x960 -o gen
|
themer -c my-colors.js -t themer-wallpaper-shirts --themer-wallpaper-shirts-size 1024x768 --themer-wallpaper-shirts-size 320x960 -o gen
|
||||||
|
|
||||||
|
The generated files will be listed in `<output dir>/README.md`.
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`themer "shirts" wallpaper should list outputfiles 1`] = `
|
||||||
|
"
|
||||||
|
Files generated:
|
||||||
|
|
||||||
|
* \`themer-wallpaper-shirts-dark-1000-1000.svg\`
|
||||||
|
* \`themer-wallpaper-shirts-light-1000-1000.svg\`
|
||||||
|
"
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`themer "shirts" wallpaper should render valid SVG 1`] = `
|
exports[`themer "shirts" wallpaper should render valid SVG 1`] = `
|
||||||
"
|
"
|
||||||
<svg width=\\"2880\\" height=\\"1800\\" viewBox=\\"0 0 2880 1800\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\">
|
<svg width=\\"2880\\" height=\\"1800\\" viewBox=\\"0 0 2880 1800\\" fill=\\"none\\" xmlns=\\"http://www.w3.org/2000/svg\\">
|
||||||
|
@ -2,6 +2,7 @@ const {
|
|||||||
getSizesFromOptOrDefault,
|
getSizesFromOptOrDefault,
|
||||||
deepFlatten,
|
deepFlatten,
|
||||||
colorSets: getColorSets,
|
colorSets: getColorSets,
|
||||||
|
listOutputFiles,
|
||||||
} = require('themer-utils');
|
} = require('themer-utils');
|
||||||
|
|
||||||
const CELL_WIDTH = 676;
|
const CELL_WIDTH = 676;
|
||||||
@ -698,4 +699,5 @@ const render = (colors, options) => {
|
|||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
render,
|
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 "shirts" wallpaper', () => {
|
describe('themer "shirts" wallpaper', () => {
|
||||||
@ -9,5 +9,10 @@ describe('themer "shirts" wallpaper', () => {
|
|||||||
});
|
});
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
})
|
});
|
||||||
|
it('should list outputfiles', async () => {
|
||||||
|
const files = await Promise.all(render(colors, { 'themer-wallpaper-shirts-size': '1000x1000' }));
|
||||||
|
const instructions = renderInstructions(files.map(({ name }) => name));
|
||||||
|
expect(instructions).toMatchSnapshot();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
@ -24,7 +24,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/mjswensen/themer/tree/master/cli/packages/themer-wallpaper-shirts#readme",
|
"homepage": "https://github.com/mjswensen/themer/tree/master/cli/packages/themer-wallpaper-shirts#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