|
| 1 | +const path = require('path') |
| 2 | +const resolve = file => path.resolve(__dirname, file) |
| 3 | + |
| 4 | +const locales = require(resolve('../util/locales.js')) |
| 5 | +const iconfonts = require(resolve('../util/iconfonts.js')) |
| 6 | + |
| 7 | +module.exports = api => { |
| 8 | + api.describeConfig({ |
| 9 | + id: 'com.vuetify', |
| 10 | + name: 'Vuetify configuration (in dev)', |
| 11 | + description: 'Application setup', |
| 12 | + link: 'https://vuetifyjs.com', |
| 13 | + icon: '/_plugin/vue-cli-plugin-vuetify/logo.png', |
| 14 | + onRead: ({ data, cwd }) => ({ |
| 15 | + prompts: [ |
| 16 | + { |
| 17 | + name: 'locale', |
| 18 | + message: 'Locale', |
| 19 | + description: 'Default application language', |
| 20 | + default: 'en', |
| 21 | + link: 'https://vuetifyjs.com/framework/internationalization#getting-started', |
| 22 | + type: 'list', |
| 23 | + choices: locales |
| 24 | + }, |
| 25 | + { |
| 26 | + name: 'theme', |
| 27 | + message: 'Custom Theme', |
| 28 | + description: 'Specify custom theme values', |
| 29 | + default: false, |
| 30 | + link: 'https://vuetifyjs.com/style/theme', |
| 31 | + type: 'confirm' |
| 32 | + }, |
| 33 | + { |
| 34 | + name: 'theme-primary', |
| 35 | + message: 'Primary color', |
| 36 | + default: '#1976D2', |
| 37 | + type: 'input', |
| 38 | + when: answers => answers.theme |
| 39 | + }, |
| 40 | + { |
| 41 | + name: 'theme-secondary', |
| 42 | + message: 'Secondary color', |
| 43 | + default: '#424242', |
| 44 | + type: 'input', |
| 45 | + when: answers => answers.theme |
| 46 | + }, |
| 47 | + { |
| 48 | + name: 'theme-accent', |
| 49 | + message: 'Accent color', |
| 50 | + default: '#82B1FF', |
| 51 | + type: 'input', |
| 52 | + when: answers => answers.theme |
| 53 | + }, |
| 54 | + { |
| 55 | + name: 'theme-success', |
| 56 | + message: 'Success color', |
| 57 | + default: '#4CAF50', |
| 58 | + type: 'input', |
| 59 | + when: answers => answers.theme |
| 60 | + }, |
| 61 | + { |
| 62 | + name: 'theme-info', |
| 63 | + message: 'Info color', |
| 64 | + default: '#2196F3', |
| 65 | + type: 'input', |
| 66 | + when: answers => answers.theme |
| 67 | + }, |
| 68 | + { |
| 69 | + name: 'theme-warning', |
| 70 | + message: 'Warning color', |
| 71 | + default: '#FFC107', |
| 72 | + type: 'input', |
| 73 | + when: answers => answers.theme |
| 74 | + }, |
| 75 | + { |
| 76 | + name: 'theme-error', |
| 77 | + message: 'Error color', |
| 78 | + default: '#FF5252', |
| 79 | + type: 'input', |
| 80 | + when: answers => answers.theme |
| 81 | + }, |
| 82 | + { |
| 83 | + name: 'custom-properties', |
| 84 | + message: 'CSS Variables', |
| 85 | + description: 'Create css variables from defined theme', |
| 86 | + default: false, |
| 87 | + link: 'https://vuetifyjs.com/style/theme#options', |
| 88 | + type: 'confirm' |
| 89 | + }, |
| 90 | + { |
| 91 | + name: 'icons', |
| 92 | + message: 'Icon font', |
| 93 | + description: 'Application icon defaults', |
| 94 | + default: 'md', |
| 95 | + link: 'https://vuetifyjs.com/framework/icons#using-custom-icons', |
| 96 | + type: 'list', |
| 97 | + choices: iconfonts |
| 98 | + }, |
| 99 | + { |
| 100 | + name: 'rtl', |
| 101 | + message: 'RTL', |
| 102 | + description: 'Enable Right to Left support', |
| 103 | + default: false, |
| 104 | + link: 'https://vuetifyjs.com/framework/internationalization#rtl', |
| 105 | + type: 'confirm' |
| 106 | + } |
| 107 | + ] |
| 108 | + }), |
| 109 | + onWrite: ({ |
| 110 | + prompts, |
| 111 | + answers, |
| 112 | + data, |
| 113 | + files, |
| 114 | + cwd, |
| 115 | + api |
| 116 | + }) => { |
| 117 | + // |
| 118 | + } |
| 119 | + }) |
| 120 | +} |
0 commit comments