Implement renderInstructions in themer-wallpaper-octagon
This commit is contained in:
parent
67f01ea123
commit
7c60412aa6
@ -33,3 +33,5 @@ By default, `themer-wallpaper-octagon` will output wallpapers at the following s
|
|||||||
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-octagon --themer-wallpaper-octagon-size 1024x768 --themer-wallpaper-octagon-size 320x960 -o gen
|
themer -c my-colors.js -t themer-wallpaper-octagon --themer-wallpaper-octagon-size 1024x768 --themer-wallpaper-octagon-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 "octagon" wallpaper should list outputfiles 1`] = `
|
||||||
|
"
|
||||||
|
Files generated:
|
||||||
|
|
||||||
|
* \`themer-wallpaper-octagon-dark-1000x1000.svg\`
|
||||||
|
* \`themer-wallpaper-octagon-light-1000x1000.svg\`
|
||||||
|
"
|
||||||
|
`;
|
@ -1,7 +1,8 @@
|
|||||||
const {
|
const {
|
||||||
getSizesFromOptOrDefault,
|
getSizesFromOptOrDefault,
|
||||||
colorSets: getColorSets,
|
colorSets: getColorSets,
|
||||||
deepFlatten
|
deepFlatten,
|
||||||
|
listOutputFiles,
|
||||||
} = require('themer-utils');
|
} = require('themer-utils');
|
||||||
|
|
||||||
const render = (colors, options) => {
|
const render = (colors, options) => {
|
||||||
@ -90,4 +91,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'),
|
||||||
{ colors } = require('../../themer-colors-default');
|
{ colors } = require('../../themer-colors-default');
|
||||||
|
|
||||||
describe('themer "octagon" wallpaper', () => {
|
describe('themer "octagon" wallpaper', () => {
|
||||||
@ -51,4 +51,10 @@ describe('themer "octagon" wallpaper', () => {
|
|||||||
test('when given only a dark theme', { dark: colors.dark }, 2);
|
test('when given only a dark theme', { dark: colors.dark }, 2);
|
||||||
test('when given only a light theme', { light: colors.light }, 2);
|
test('when given only a light theme', { light: colors.light }, 2);
|
||||||
|
|
||||||
|
it('should list outputfiles', async () => {
|
||||||
|
const files = await Promise.all(render(colors, { 'themer-wallpaper-octagon-size': '1000x1000' }));
|
||||||
|
const instructions = renderInstructions(files.map(({ name }) => name));
|
||||||
|
expect(instructions).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/mjswensen/themer/tree/master/cli/packages/themer-wallpaper-octagon#readme",
|
"homepage": "https://github.com/mjswensen/themer/tree/master/cli/packages/themer-wallpaper-octagon#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"themer-utils": "^1.1.0"
|
"themer-utils": "^1.2.0"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"themer",
|
"themer",
|
||||||
|
Loading…
Reference in New Issue
Block a user