Skip to content
This repository was archived by the owner on May 8, 2025. It is now read-only.

Commit 875af38

Browse files
johnleiderMert75
andauthored
refactor(presets): re-organize structure (#199)
* relocate files * added essential preset * essential & base * template wrap presets & generator * refactor base & essential folders * added default index and prompt files * feat: prompts and generators seperated * feat: init generator for material studies * chore(essential-preset): remove unnecessary files * chore: add missing package.json for presets * chore(generator): create new generator process * chore(package.json): add publishConfig public access * chore: release - @vuetify/vue-cli-plugin-presets@0.1.0-alpha.0 * fix(presets): add missing index.js file for vue-cli plugins * chore: release - @vuetify/vue-cli-plugin-presets@0.1.0-alpha.1 * style(prompts.js): clean-up code styling * refactor(presets): update prompts file * chore: release - @vuetify/vue-cli-plugin-presets@0.1.0-alpha.2 * fix(presets): update onCreateComplete cb * chore: release - @vuetify/vue-cli-plugin-presets@0.1.0-alpha.3 * chore: testing new install * chore: release - @vuetify/vue-cli-plugin-presets@0.1.0-alpha.4 * fix(presets): resolve missing variable in generator * chore: release - @vuetify/vue-cli-plugin-presets@0.1.0-alpha.5 * refactor(presets): update prompts file * chore: release - @vuetify/vue-cli-plugin-presets@0.1.0-alpha.6 Co-authored-by: Mert <mertpolat.98@hotmail.com> Co-authored-by: yeah <33829677+Mert75@users.noreply.github.com>
1 parent 242d040 commit 875af38

File tree

109 files changed

+637
-166
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+637
-166
lines changed

β€Žpackages/@vuetify/base/.gitignoreβ€Ž

Lines changed: 0 additions & 1 deletion
This file was deleted.

β€Žpackages/@vuetify/base/CHANGELOG.mdβ€Ž

Lines changed: 0 additions & 129 deletions
This file was deleted.

β€Žpackages/@vuetify/base/index.jsβ€Ž

Lines changed: 0 additions & 1 deletion
This file was deleted.

β€Žpackages/@vuetify/base/package.jsonβ€Ž

Lines changed: 0 additions & 18 deletions
This file was deleted.

β€Žpackages/@vuetify/base/yarn.lockβ€Ž

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = (api, { cstudy, study }) => {
2+
// Abort if user doesn't want a Material study preset
3+
if (!cstudy) return;
4+
5+
api.onCreateComplete(async () => {
6+
const presetName = `Vuetify Material Study ${study} preset`
7+
const projectName = api.rootOptions.projectName
8+
let subprocess
9+
10+
try {
11+
subprocess = await run(api, `vue add @vuetify/vuetify-preset-${study}`)
12+
} catch (err) {
13+
console.warn(err)
14+
}
15+
16+
if (!subprocess) {
17+
return console.error(`Unable to add Material Study preset ${study}.`)
18+
}
19+
20+
subprocess.stdout.on('close', async () => {
21+
console.log(`🍣 Successfully generated ${projectName} from the ${presetName}.\n`)
22+
})
23+
})
24+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
module.exports = [
2+
{
3+
type: 'confirm',
4+
name: 'cstudy',
5+
message: 'Install a Material Study preset?',
6+
default: false
7+
},
8+
{
9+
type: 'list',
10+
name: 'study',
11+
message: 'Select preset:',
12+
when: answers => answers.cstudy,
13+
choices: [
14+
{ name: 'Basil', value: 'basil' },
15+
{ name: 'Crane', value: 'crane' },
16+
{ name: 'Fortnightly', value: 'fortnightly' },
17+
{ name: 'Owl', value: 'owl' },
18+
{ name: 'Rally', value: 'rally' },
19+
{ name: 'Reply', value: 'reply' },
20+
{ name: 'Shrine', value: 'shrine' }
21+
]
22+
},
23+
]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
module.exports = (api, opts) => {
2+
if (!api.hasPlugin('vuetify')) {
3+
console.log('`@vuetify/presets/material-studies` requires the `vue-cli-plugin-vuetify` package.')
4+
return
5+
} else if (api.hasPlugin(`${opts.study}`)) {
6+
console.log(`${opts.study} has already been installed!`);
7+
return
8+
}
9+
10+
api.render(`./vue-cli-plugin-vuetify-preset-${opts.study}`)
11+
12+
api.onCreateComplete(() => {
13+
api.exitLog('Discord community: https://community.vuetifyjs.com')
14+
api.exitLog('Github: https://github.com/vuetifyjs/vuetify')
15+
api.exitLog('Support Vuetify: https://github.com/sponsors/johnleider')
16+
})
17+
}

0 commit comments

Comments
Β (0)