Skip to content

Commit

Permalink
chore: update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanvanherwijnen committed Dec 2, 2024
1 parent c355dc4 commit 657fff8
Show file tree
Hide file tree
Showing 10 changed files with 4,213 additions and 3,350 deletions.
6 changes: 6 additions & 0 deletions .changeset/violet-starfishes-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'create-simple-site-generator': patch
'@simple-site-generator/templates': patch
---

chore: update dependencies
22 changes: 11 additions & 11 deletions packages/create-simple-site-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@
},
"homepage": "https://github.com/simsustech/simple-site-generator/tree/main/packages/create-simple-site-generator#readme",
"dependencies": {
"@vitrify/tools": "^0.1.0",
"handlebars": "^4.7.7",
"inquirer": "^8.2.2",
"latest-version": "^7.0.0",
"minimist": "^1.2.6"
"@inquirer/prompts": "^7.1.0",
"@vitrify/tools": "^0.2.3",
"handlebars": "^4.7.8",
"latest-version": "^9.0.0",
"minimist": "^1.2.8"
},
"devDependencies": {
"@types/inquirer": "^8.2.1",
"@types/minimist": "^1.2.2",
"@types/node": "^17.0.23",
"typescript": "^4.7.3",
"vite": "^4.0.1",
"vue": "^3.2.37"
"@types/inquirer": "^9.0.7",
"@types/minimist": "^1.2.5",
"@types/node": "^22.10.1",
"typescript": "^5.7.2",
"vite": "^6.0.2",
"vue": "^3.5.13"
},
"files": [
"dist",
Expand Down
106 changes: 48 additions & 58 deletions packages/create-simple-site-generator/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import {
renderTsconfigJson
} from '@vitrify/tools/render'
import parseArgs from 'minimist'
import type { QuestionCollection } from 'inquirer'
import inquirer from 'inquirer'
import { input, rawlist } from '@inquirer/prompts'
import { promises } from 'fs'
import { templates } from './templates.js'
const escape = (val: any) => JSON.stringify(val).slice(1, -1)
Expand All @@ -15,66 +14,51 @@ const argv = parseArgs(process.argv.slice(2), {
string: ['template']
})

let questions: QuestionCollection[] = []
let templateName: string
if (!argv.template) {
questions = [
...questions,
{
type: 'list',
name: 'template',
message: 'Which template would you like to use?',
choices: Object.entries(templates).map(([key, value]) => ({
name: value.fullName,
value: key,
short: value.description
}))
}
]
templateName = await rawlist({
message: 'Which template would you like to use?',
choices: Object.entries(templates).map(([key, value]) => ({
name: value.fullName,
value: key,
short: value.description
}))
})
} else {
templateName = argv.template
}

questions = [
...questions,
{
type: 'input',
name: 'name',
message: 'Package name',
validate: (val: string) => val && val.length > 0,
default: (answers: Record<string, any>) => {
return argv._[0]
}
},
{
type: 'input',
name: 'url',
message: 'Website URL',
validate: (val: string) => val && val.length > 0,
default: 'www.example.com'
},
{
type: 'input',
name: 'productName',
const name = await input({
message: 'Package name',
validate: (val: string) => val && val.length > 0,
default: argv._[0]
})

const url = await input({
message: 'Website URL',
validate: (val: string) => val && val.length > 0,
default: 'www.example.com'
})

let productName: string = ''
if (templateName !== 'plugin') {
productName = await input({
message: 'Project product name',
default: 'App',
when: (answers) => {
return answers.template !== 'plugin'
},
validate: (val: string) => val && val.length > 0,
transformer: escape
},
{
type: 'input',
name: 'description',
message: 'Project description',
default: 'A Vitrify app',
transformer: escape
},
{
type: 'input',
name: 'author',
message: 'Author'
}
]
const answers = await inquirer.prompt(questions)
})
}

const description = await input({
message: 'Project description',
default: 'A Vitrify app',
transformer: escape
})

const author = await input({
message: 'Author'
})

interface TemplateVariables {
template: string
Expand All @@ -84,12 +68,18 @@ interface TemplateVariables {
author: string
}
const cwdUrl = new URL('', `file://${process.cwd()}/`)
const templateVariables = answers as TemplateVariables
const templateVariables = {
template: templateName,
name,
productName,
description,
author
} as TemplateVariables
// @ts-ignore
const template = templates[answers.template] || templates[argv.template]
const template = templates[templateName]

const directoryUrl = template.url
const outputDir = new URL(`./${answers.name}/`, cwdUrl)
const outputDir = new URL(`./${name}/`, cwdUrl)

await renderDirectory({
directoryUrl,
Expand Down
1 change: 1 addition & 0 deletions packages/create-simple-site-generator/src/templates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export const templates: Templates = {
'@fastify/static',
'@quasar/extras',
'quasar',
'vite-plugin-pwa',
'vue',
'vue-router'
])),
Expand Down
2 changes: 1 addition & 1 deletion packages/create-simple-site-generator/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"strict": true,
"module": "esnext",
"moduleResolution": "Nodenext",
"moduleResolution": "bundler",
"target": "ES2020",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"skipLibCheck": true,
Expand Down
22 changes: 11 additions & 11 deletions packages/simple-site-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@
},
"homepage": "https://github.com/simsustech/simple-site-generator/tree/main/packages/simple-site-generator#readme",
"dependencies": {
"@vitrify/tools": "^0.1.0",
"handlebars": "^4.7.7",
"inquirer": "^8.2.2",
"latest-version": "^7.0.0",
"minimist": "^1.2.6"
"@vitrify/tools": "^0.2.3",
"handlebars": "^4.7.8",
"inquirer": "^12.1.0",
"latest-version": "^9.0.0",
"minimist": "^1.2.8"
},
"devDependencies": {
"@types/inquirer": "^8.2.1",
"@types/minimist": "^1.2.2",
"@types/node": "^17.0.23",
"typescript": "^4.7.3",
"vite": "^4.0.1",
"vue": "^3.2.37"
"@types/inquirer": "^9.0.7",
"@types/minimist": "^1.2.5",
"@types/node": "^22.10.1",
"typescript": "^5.7.2",
"vite": "^6.0.2",
"vue": "^3.5.13"
},
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion packages/simple-site-generator/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"compilerOptions": {
"strict": true,
"module": "esnext",
"moduleResolution": "Nodenext",
"moduleResolution": "bundler",
"target": "ES2020",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"skipLibCheck": true,
Expand Down
22 changes: 11 additions & 11 deletions packages/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
"dependencies": {
"@quasar/quasar-ui-qmarkdown": "^2.0.0-beta.6",
"@quasar/quasar-ui-qmediaplayer": "^2.0.0-beta.6",
"import-meta-resolve": "^3.0.0",
"unplugin-vue-components": "^0.25.2"
"import-meta-resolve": "^4.1.0",
"unplugin-vue-components": "^0.27.5"
},
"devDependencies": {
"@types/node": "^20.6.0",
"@vitejs/plugin-vue": "4.3.4",
"@vue/runtime-dom": "^3.3.4",
"quasar": "^2.12.6",
"sass": "^1.66.1",
"typescript": "^5.2.2",
"vite": "^4.4.9",
"vue": "^3.3.4",
"vue-router": "^4.2.4"
"@types/node": "^22.10.1",
"@vitejs/plugin-vue": "5.2.1",
"@vue/runtime-dom": "^3.5.13",
"quasar": "^2.17.4",
"sass": "^1.81.0",
"typescript": "^5.7.2",
"vite": "^6.0.2",
"vue": "^3.5.13",
"vue-router": "^4.5.0"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/templates/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node",
"moduleResolution": "bundler",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"types": ["vue", "vite/client", "node"],
"skipLibCheck": true,
Expand Down
Loading

0 comments on commit 657fff8

Please sign in to comment.