Implement renderInstructions in themer-brave
This commit is contained in:
parent
34ddc8081a
commit
fcaa3bf164
@ -12,14 +12,4 @@ Then pass `themer-brave` as a `-t` (`--template`) arg to `themer`:
|
|||||||
|
|
||||||
themer -c my-colors.js -t themer-brave -o gen
|
themer -c my-colors.js -t themer-brave -o gen
|
||||||
|
|
||||||
## Output
|
Installation instructions for the generated theme(s) will be included in `<output dir>/README.md`.
|
||||||
|
|
||||||
`themer-brave` will generate a `Themer Dark` or `Themer Light` directory (or both, depending on the color set you passed to `themer`) in your output path.
|
|
||||||
|
|
||||||
To install your generated theme:
|
|
||||||
|
|
||||||
1. Launch Brave and nagivate to `brave://extensions`.
|
|
||||||
2. Turn on the "Developer mode" toggle at the top.
|
|
||||||
3. Click the "Load unpacked extension..." button and choose your `Themer Dark` or `Themer Light` directory.
|
|
||||||
|
|
||||||
(To reset or remove your theme, visit `brave://settings` and click "Reset to Default" in the "Appearance" section.)
|
|
||||||
|
@ -0,0 +1,11 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`Brave theme generator should provide installation instructions 1`] = `
|
||||||
|
"
|
||||||
|
1. Launch Brave and go to \`brave://extensions\`.
|
||||||
|
2. Check the \\"Developer mode\\" checkbox at the top.
|
||||||
|
3. Click the \\"Load unpacked extension...\\" button and choose the desired theme directory (\`Themer Dark\` or \`Themer Light\`).
|
||||||
|
|
||||||
|
(To reset or remove the theme, visit \`brave://settings\` and click \\"Reset to Default\\" in the \\"Appearance\\" section.)
|
||||||
|
"
|
||||||
|
`;
|
@ -1 +1,11 @@
|
|||||||
module.exports = require('themer-chrome');
|
const { render, renderInstructions: renderChromeInstructions } = require('themer-chrome');
|
||||||
|
|
||||||
|
const renderInstructions = paths =>
|
||||||
|
renderChromeInstructions(paths)
|
||||||
|
.replace(/chrome/g, 'brave')
|
||||||
|
.replace(/Chrome/g, 'Brave');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
render,
|
||||||
|
renderInstructions
|
||||||
|
};
|
||||||
|
10
cli/packages/themer-brave/lib/index.spec.js
Normal file
10
cli/packages/themer-brave/lib/index.spec.js
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
const { render, renderInstructions } = require('./index');
|
||||||
|
const { colors } = require('../../themer-colors-default');
|
||||||
|
|
||||||
|
describe('Brave theme generator', () => {
|
||||||
|
it('should provide installation instructions', async () => {
|
||||||
|
const files = await Promise.all(render(colors));
|
||||||
|
const instructions = renderInstructions(files.map(({ name }) => name));
|
||||||
|
expect(instructions).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
});
|
@ -28,7 +28,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/mjswensen/themer/tree/master/cli/packages/themer-brave#readme",
|
"homepage": "https://github.com/mjswensen/themer/tree/master/cli/packages/themer-brave#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"themer-chrome": "^1.1.0"
|
"themer-chrome": "^1.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {},
|
"devDependencies": {},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
Loading…
Reference in New Issue
Block a user