vue-cli-plugin-vuestic-ui
Advanced tools
Comparing version 1.0.6 to 1.0.7
module.exports = { | ||
importStrings: [ | ||
"import { VuesticPlugin } from 'vuestic-ui'", | ||
"import 'vuestic-ui/dist/vuestic-ui.css'", | ||
"import { createVuestic } from 'vuestic-ui'", | ||
"import 'vuestic-ui/css'", | ||
], | ||
extendPackage: { | ||
dependencies: { | ||
'vuestic-ui': '^1.4.0', | ||
'vuestic-ui': '^1.4.1', | ||
} | ||
}, | ||
vueUse: [ | ||
'VuesticPlugin' | ||
'createVuestic()' | ||
] | ||
} |
module.exports = { | ||
importStrings: (answers) => { | ||
const strings = [ | ||
"import { VuesticPluginsWithoutComponents } from 'vuestic-ui'", | ||
"import 'vuestic-ui/dist/styles/essential.css'", | ||
"import { createVuesticEssential, VaButton } from 'vuestic-ui'", | ||
"import 'vuestic-ui/css'", | ||
// "import 'vuestic-ui/styles/essential.css'", | ||
] | ||
if (answers.treeshakingOptions.includes('grid')) { | ||
strings.push("import 'vuestic-ui/dist/styles/grid/grid.scss'") | ||
} | ||
// TODO: Move back when CSS code split will work good | ||
// if (answers.treeshakingOptions.includes('grid')) { | ||
// strings.push("import 'vuestic-ui/styles/grid/grid.css'") | ||
// } | ||
if (answers.treeshakingOptions.includes('normalize')) { | ||
strings.push("import 'vuestic-ui/dist/styles/global/normalize.scss'") | ||
} | ||
// if (answers.treeshakingOptions.includes('normalize')) { | ||
// strings.push("import 'vuestic-ui/styles/global/normalize.css'") | ||
// } | ||
if (answers.treeshakingOptions.includes('typography')) { | ||
strings.push("import 'vuestic-ui/dist/styles/global/typography.scss'") | ||
} | ||
// if (answers.treeshakingOptions.includes('typography')) { | ||
// strings.push("import 'vuestic-ui/styles/global/typography.css'") | ||
// } | ||
@@ -23,4 +25,4 @@ return strings | ||
vueUse: [ | ||
'VuesticPluginsWithoutComponents', | ||
'createVuesticEssential({ components: { VaButton } })', | ||
] | ||
} |
@@ -7,3 +7,2 @@ const fs = require('fs') | ||
const executeIfFunction = require('./utils/executeIfFunction') | ||
const getPackageJson = require('./utils/getPackageJSON') | ||
const resolveDependency = require('./utils/resolveDependency') | ||
@@ -10,0 +9,0 @@ |
@@ -5,2 +5,4 @@ const fs = require('fs') | ||
/** | ||
* Returns user's package.json. | ||
* @notice not vuestic package.json! | ||
* @throw Can not find package.json. | ||
@@ -7,0 +9,0 @@ */ |
@@ -1,2 +0,2 @@ | ||
const insertVuesticPlugin = (lines, pluginName = 'VuesticPlugin') => { | ||
const insertVuesticPlugin = (lines, pluginName = 'createVuestic()') => { | ||
const alreadyExists = lines.findIndex(line => line.includes(`.use(${pluginName})`)) | ||
@@ -3,0 +3,0 @@ |
@@ -8,3 +8,3 @@ const getPackageJSON = require("./getPackageJSON") | ||
/** | ||
* Resolves dependency version from dependencies or devDependencies. | ||
* Resolves dependency version from user's dependencies or devDependencies. | ||
* @param {string} dependency - dependency name to resolve | ||
@@ -11,0 +11,0 @@ * */ |
{ | ||
"name": "vue-cli-plugin-vuestic-ui", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Vuestic UI plugin for Vue CLI v4+", | ||
@@ -5,0 +5,0 @@ "homepage": "https://vuestic.dev", |
@@ -9,32 +9,32 @@ // prompts.js | ||
name: 'treeshaking', | ||
message: 'Use treeshaking?', | ||
message: 'Use treeshaking? You can configure it later.', | ||
default: true | ||
}, | ||
// { | ||
// type: 'checkbox', | ||
// name: 'treeshakingOptions', | ||
// message: 'Select features that you want to use', | ||
// default: [ | ||
// 'grid', 'normalize', 'typography' | ||
// ], | ||
// when: (answers) => answers.treeshaking, | ||
// choices: [ | ||
// { | ||
// name: 'CSS Grid', | ||
// value: 'grid', | ||
// short: 'CSS Grid' | ||
// }, | ||
// { | ||
// name: 'Vuestic Normalize CSS module', | ||
// value: 'normalize', | ||
// short: 'Normalize CSS' | ||
// }, | ||
// { | ||
// name: 'Vuestic Typography module', | ||
// value: 'typography', | ||
// short: 'Typography' | ||
// } | ||
// ] | ||
// }, | ||
{ | ||
type: 'checkbox', | ||
name: 'treeshakingOptions', | ||
message: 'Select features that you want to use', | ||
default: [ | ||
'grid', 'normalize', 'typography' | ||
], | ||
when: (answers) => answers.treeshaking, | ||
choices: [ | ||
{ | ||
name: 'CSS Grid', | ||
value: 'grid', | ||
short: 'CSS Grid' | ||
}, | ||
{ | ||
name: 'Vuestic Normalize CSS module', | ||
value: 'normalize', | ||
short: 'Normalize CSS' | ||
}, | ||
{ | ||
name: 'Vuestic Typography module', | ||
value: 'typography', | ||
short: 'Typography' | ||
} | ||
] | ||
}, | ||
{ | ||
type: 'confirm', | ||
@@ -41,0 +41,0 @@ name: 'agGrid', |
@@ -25,2 +25,5 @@ # vue-cli-plugin-vuestic-ui | ||
vue invoke vuestic-ui | ||
``` | ||
``` | ||
Vue cli plugin creates vuestic's environment based on user's answers. Reaction to answers can be changed or created in `generator/configs`. | ||
Tempplates for vite or webpack can be found in `generator/templates`. |
8720
198
28